Nice extension, and working great as is. I even used the EXUploadAction file.
However, I would like to integrate this extension in a wider project, and use it as the upload solution for profile photos. The thing is that i need to change the filename (when upload completed) according to a additional data from the form. With the onComplete callback i should update the profile photo.
Since now, i managed to change the filename in the EXUploadAction file (i don’t want to temper with the extension code) using a dummy name, but the callback always gives me the original filename.
How can I send an additional data with the form ? How to rename the file so the onComplete callBack returns the modified name ?
The files[index].name refers to the current html file field objects, because the name changed in the server and not on the client side this variable is not updated.
What you should use instead is handler.response which holds the JSON response from the server, this JSON is constructed in the action, for XUploadAction:
line 30. echo json_encode(array("name" => $model->name,"type" => $model->mime_type,"size"=> $model->getReadableFileSize()));
There you can add/remove/change any information you want to send back to the client here.
In your specific case, if you changed $model->name before that line, then the JSON already holds the correct name. so your code should look like:
check new version of http://aquantum-demo.appspot.com/file-upload there you can have thumbs directly from your local disk drive, and after upload you also can have resized image.
By the way, for those interested in… my onComplete callback should refresh the image in the div when new file is uploaded. Since the file is renamed with the same name, the image never changes (because of the cache surely).
Well, here goes the work around, just add a time stamp as a parameter for the image file url. This will force a GET.
The documentation in the yii site its about the installation and basic usage, the documentation your guys are asking for, its the jquery documentation.
The answers to all this questions are in the wiki, please take a look there.
Hi, anybody know how to implement multiple instances of the widget in a single page, I’ve created 2 juidialog and loaded a widget on each one from diferent views, but when a add I file to the second xupload widget it is queued to the first one, so how do I add files to each one separately, thank you
The jquery plugin has been updated to a new version, however the new documentation lacks many examples for common task, the old wiki has been restored and the examples are now back for the old version, please vote here to update or not the extension. take into account the lack of documentation for the new version.