3D File Manager

This page displays all STL files uploaded by users through the 3D Print Pricing Calculator plugin.

No STL files found.

Preview File Name Uploaded By Upload Date File Size Actions
Download
×

File Details

File Name:

Uploaded By:

Upload Date:

File Size:

basename($file['path']), 'file_path' => $file['path'], 'file_url' => $file['url'], 'upload_date' => date('Y-m-d H:i:s', $file['modified']), 'user_id' => 0, // Unknown user 'user_name' => 'Unknown', // Unknown user 'file_size' => $file['size'] ); } // Store the metadata update_option('ppc3d_uploaded_files', $metadata); } /** * Recursively find all STL files in a directory * This is only used for the initial migration of existing files */ function ppc3d_find_stl_files_in_directory($dir) { $files = array(); $upload_dir = wp_upload_dir(); if (!is_dir($dir)) { return $files; } $items = scandir($dir); foreach ($items as $item) { if ($item === '.' || $item === '..') { continue; } $path = $dir . '/' . $item; if (is_dir($path)) { $files = array_merge($files, ppc3d_find_stl_files_in_directory($path)); } else { $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION)); if ($ext === 'stl') { $file_url = str_replace($upload_dir['basedir'], $upload_dir['baseurl'], $path); $files[] = array( 'path' => $path, 'url' => $file_url, 'size' => filesize($path), 'modified' => filemtime($path) ); } } } return $files; }