0 users online. Create an account or sign in to join them.Users
This is a closed discussion with 1 reply.
Search
Create an account or sign in to comment.
0 users online. Create an account or sign in to join them.Users
This is a closed discussion with 1 reply.
Create an account or sign in to comment.
Symphony • Open Source XSLT CMS
--with-xsl)
I’m working on an extension that adds a progress bar to all upload fields in Symphony. It’s a Flash/JavaScript solution, so it adds a layer on top of existing field types (native File Upload, or the Unique Upload, Hashed File Upload etc.).
View of it in action: http://nick-dunn.co.uk/assets/files/uploadify.mov
Progress so far: http://github.com/nickdunn/uploadify/tree/master
The UI is almost complete, although the JavaScript will be tidied and written as an object.
However I’m after some help with the saving of the image. Presently the upload posts to a script (
upload.phpincluded with the extension) which handles the file save:if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; if (move_uploaded_file($tempFile,$targetFile)) { echo "1"; } else { echo "0"; } }The script correctly received the right folder, and file-selection honours the regex file extensions when creating an upload field.
However my beef is that this is bypassing the field’s own upload mechanism. If I apply the JS to a Hashed Upload Field, the hashing mechanism won’t be applied since I’m just uploading with a different script. What I’m after is a Symphony solution.
What I think it needs is a content page in the extension that:
So I want to call the upload on an instantiated field, but without creating an entry. Would any extension aficionados care to lend a hand?