Search

Updates

  • I've integrated html5 into the extension, but if you choose a large amount of files it will timeout
  • There is currently no queue or progress bar, it simply posts all the files.
  • It should also now work with ANY upload field, but I have not tested it yet.
  • It no longer uses shell exec.
  • It no longer creates a directory in your workspace folder.

Bugs

  • If you receive an error on the form, you have to select all the files again
  • No notification is received on the index after successful input
  • If more than one upload field is in a section, this will fail, not gracefully

It's a proof of concept, but if you're interested in seeing what it looks like, it's at https://github.com/scottkf/massuploadutility

Mass Upload Utility updated to version 0.9.1 on 9th of May 2011

https://github.com/scottkf/massuploadutility/tree/v0.9.1

Inching towards 1.0 after 2 years! If you guys could test this out it'd be amazing.

Updates

v0.9.1

  • Should work with every upload field and custom field (needs testing)
  • Flash is no longer used at all, it's pure html5
  • Added localisation (most of the text exists in JS, but there's a couple in php)
  • The workflow is now exactly the same as it is for adding a regular entry, with the exception that you can select multiple files, and when you do, thats when my utility kicks in.

Usage

  1. Go to the index of a section with an upload field
  2. Click the button that says 'Create new'
  3. If there's an upload field, my script will turn on, select multiple files, enter other values as necessary, and click 'Create Entry'

TODO

  • Still need to figure out what to do for error checking if a file fails to validate, rollback or skip? Currently just skipping and highlighting
  • Repopulate the upload list (or don't delete) if a file fails to upload for whatever reason
  • Add {#} variables or something so a field can change dynamically
  • Notify the user that it's possible to select multiple files
  • Check for html5 support before doing anything

BUGS

  • If you receive an error on the form, you have to select all the files again
  • If more than one upload field is in a section, this will fail on purpose (feature?)

Tested on 2.2.1 on Windows: seems to work well!

I would say the UI is not 100% completed yet: it took me a while to figure out I could just select multiple files, nothing else needed. Also, when files are selected, this is not reported back to the user. And, it might be nice to make it optional for sections to allow mass uploading.

Other than that, it looks good! Nice work!

Mass Upload Utility updated to version 0.9.2 on 10th of May 2011

alt text

https://github.com/scottkf/massuploadutility

@cd, I took all your suggestions and implemented them! Thanks for the feedback. Everything still seems to work.

I also added the ability to dynamically change an input[text] field with data, but only numbers are supported currently. If you upload 3 files, and you type in 'hello {$number}' into a text field, the entries would look like 'hello 0', 'hello 1', 'hello 2'

v0.9.2

  • Added ability to exclude sections and users (I stole this from Craig's tracker extension)
  • Forgot to localise a couple strings
  • A quick blurb to let the user know they can upload multiple files
  • Checking for HTML5 support
  • Added support for using variables in any other input field, like {$number} will dynamically change
  • When selecting files, they're populated to the queue so you know you queued files

If anyone's interested in properly localising a few strings (not google translate :), I would appreciate it! All the text to be translated is here (the php) and here (the javascript)

Thanks Scott for this great Utility :)

I'm having a problem were I'm always getting an error:

The file uploaded is no longer available. Please check that it exists, and is readable.

do you have an idea what might be causing this ?

Thanks a million.

Attachments:
Screen shot 2011-05-11 at 10.26.21 AM.png

Do you get this error when uploading a single file? According to the core, this happens when the file doesn't exist, or isn't readable. This is strange, and seems server related.

Which could mean the JS is posting the file to the short API page that I wrote, but by the time it has to get processed it disappears, maybe this is related to case sensitivity? I'm not really sure.

Is this on a local machine, a hosting service? Any details you could provide about the system would make it easier to figure out.

I figured it could be a server issue, I'm hosted on IXwebhosting, and tried changing the permissions on the photos folder maybe that would be the reason, but still nothing.

I dont even see the photos when logging in through FTP.

I just tried some files with file names that are all lower case still same issue. do you have any idea what might it be on the server that could cause this?

thank you for all the help!

Any thoughts on 2.1.2 compatibility?

@byvisual, after some testing it's possible the javascript I wrote is incorrectly altering the wrong field. Do you have more than one upload field? I doubt that it's the case, but it's worth asking. If you could show me what your html looks like with the utility on and off, and what data is being sent to the API page (via the Network Inspector in Chrome/Safari/Firebug), including the content, the headers and response I could get to the bottom of it!

@into, I suspect it will because most of the logic relies in javascript.

Updated again. This should be the last time for a bit I suspect.

https://github.com/scottkf/massuploadutility/tree/0.9.5

v0.9.5

  • No longer clears files from the input[file] box if failed
  • Under the hood changes, no longer duplicates Symphony code, uses a custom event to add entries. Inspiration and thanks to Nick Dunn and his REST API extension!
  • Will highlight which fields have problems and display errors on them (except the upload field) This may get obnoxious and I might turn it off. This is instead of showing them in the queue list. It's customizable by changing a variable in the javascript.

no actually there is only one upload field in the section.

here are the server requests made by the JS, it seems to be posting the image but after that it is not able to locate it.

headers:

Request URL:http://thenewghalis.com/symphony/extension/massuploadutility/?MAX_FILE_SIZE=5242880&fields%5Btitle%5D=&fields%5Bdescription%5D=&MUUsource=photos&fields%5Bdate%5D=12+May+2011+15%3A28
Request Method:POST
Status Code:200 OK
Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Content-Length:83825
Content-Type:multipart/form-data; boundary=----WebKitFormBoundarynjACF10byHjIMQbJ
Cookie:__utmz=27052920.1301264054.1.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=the%20new%20ghalis; __utma=27052920.155511785.1301262978.1301947121.1301958382.7; PHPSESSID=3sq3tbvgo7uvl7lfhg4l567hu4
Host:thenewghalis.com
Origin:http://thenewghalis.com
Referer:http://thenewghalis.com/symphony/publish/photos/new/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_6) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
X-File-Name:fr_916_size580.jpeg
X-File-Size:83623
X-Requested-With:XMLHttpRequest
Query String Parameters
MAX_FILE_SIZE:5242880
fields%5Btitle%5D:
fields%5Bdescription%5D:
MUUsource:photos
fields%5Bdate%5D:12 May 2011 15:28
Request Payload
------WebKitFormBoundarynjACF10byHjIMQbJ
Content-Disposition: form-data; name="fields[image]"; filename="fr_916_size580.jpeg"
Content-Type: image/jpeg


------WebKitFormBoundarynjACF10byHjIMQbJ--
Response Headers
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Type:text/html
Date:Thu, 12 May 2011 19:33:18 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified:Thu, 12 May 2011 19:33:19 GMT
Pragma:no-cache
Server:Apache
Transfer-Encoding:chunked
X-Powered-By:PHP/5.2.17

content:

{"status":false,"message":"","errors":{"65":"The file uploaded is no longer available. Please check that it exists, and is readable."}}

Thank you for all the help, I really cannot understand where can it be getting stuck, I will try to dig through you extension code, hopefully I can find where the actual server posting is, I think the bottle neck might be there.

Thanks again.

Is the section with id 65 actually the upload field? You can check from the backend or check the database.

This wasn't very specific, when you're creating a new entry in the backend with the mass upload utility off, inspect the html, and see what the id is by looking at the div with field- wherever the upload field is.

Or simply type this in the urlbar or the console:

javascript:alert(jQuery("form input[type='file']").parents("div").attr('id'));

Hmm didnt work

the upload field is number 65 both in the backend and database, I think there is a problem with the server permissions I just cannot figure out what it is. I'll try installing symphony on a different enviroment and see if I get the same errors.

Thanks for all your help you rock! :)

Is it also compatible with the unique file upload extension? That would be the only way I'd be able to utilize it. Thanks for your help, I know my clients would be ecstatic over this feature !

Yes it works with the unique upload field; I tested it briefly. It should work with all of them.

I don't understand what this extension does to allow me to upload, I have installed it, and can see preferences, but nothing else at all.

Maybe the javascript isn't getting loaded or there's some kind of conflict then, but on a section with an upload field (only one, not more than one), you should see what appears below in the screenshot. Please check to make sure the massuploadutility.js is being loaded.

Also, it still might not be completely obvious, but you can select multiple files as you would in a regular file dialog, i.e. with shift or ctrl/command.

Attachments:
Screen shot 2011-05-16 at 1.18.25 PM.png

Mass Upload Utility updated to version 0.9.6 on 18th of May 2011

Also, it still might not be completely obvious

It wasn't but I figured it out, thanks Scott...

@scottkf

I enabled your extension but I am unable to upload multiple files in an existing entry.

I have an Articles section and I just added a Unique File Upload field to it. When I edit an existing Article I can't upload more than 1 file. If I'm creating a new Article, your extension works as expected.

Regarding the JS translation strings, how do I add the translated ones and pass them to you? I know how to do it for PHP (lang.xx.php), but for JS?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details