CARVIEW |
elcgit / s3-swf-upload-plugin
- Source
- Commits
- Network (5)
- Issues (6)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
A rails plugin which allow user upload files to S3 through an embedded flash directly. — Read more
-
onSuccess is fired if the user doesn't select a file
1 comment Created 8 months ago by GreenAsJadeThis is easy to test: just press the "Upload" link without selecting a file: you will get the "Succesfully uploaded" dialog if you have that callback installed.
I think the fix is as appended.
If only I could figure out how to recompile this to try it!
diff --git a/s3_upload.mxml b/s3_upload.mxml
index f351612..0295057 100644
--- a/s3_upload.mxml +++ b/s3_upload.mxml @@ -57,8 +57,8 @@// return if user not selected any file if (options.FileSize == null) {
trace(options.onSuccessCall);
ExternalInterface.call(options.onSuccessCall);
trace(options.onFailedCall);
ExternalInterface.call(options.onFailedCall); return; }
onSuccessCall
Comments
-
The rails app will likely need to know what file was uploaded
1 comment Created 8 months ago by GreenAsJade... this means that the onSuccess callback should pass the file name.
I think the fix is as appended. If only I could figure out how to recompile to try this out!
diff --git a/s3_upload.mxml b/s3_upload.mxml
index 0295057..01ce6b9 100644
--- a/s3_upload.mxml +++ b/s3_upload.mxml @@ -143,7 +143,7 @@selectButton.enabled = true; textInput.text = "Upload complete!"; trace(options.onSuccessCall);
ExternalInterface.call(options.onSuccessCall);
ExternalInterface.call(options.onSuccessCall, options.FileName, options.FileSize); trace(event); });
Comments
GreenAsJade Thu May 07 05:07:42 -0700 2009 | link
I've implemented & tested this enhancement, in my fork
-
... and it's clear that Event.OPEN listener is not firing, none of the actions in that function are ever activated.
I can't figure out what is making this all so flakey :S
Comments
I also have this bug. Big files work fine, but the progress meter never updates. In fact, Firefox is frozen and doesn't repaint any of its windows until the upload completes.
GreenAsJade Fri May 08 17:59:19 -0700 2009 | link
I've discovered that this is a known issue on linux:
https://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/
"Linux and Flash Upload Progress
As Tim mentions in the comments there is a problem with displaying upload progress in Flash for Linux. It is covered around the net and alos mentioned in the documentation for SWFUpload:
The uploadProgress event is fired periodically by the Flash Control. This event is useful for providing UI updates on the page. Note: The Linux Flash Player fires a single uploadProgress event after the entire file has been uploaded. This is a bug in the Linux Flash Player that we cannot work around.
So basically it’s boned on linux and there’s nothing you can do about it.
" -
"Nothing happens" on submit (freeze) if s3_upload_controller isn't authorised
2 comments Created 8 months ago by GreenAsJadeWhen the user presses "submit", the flash issues a request
to the application s3_uploads_controller.If the controller doesn't respond as expected with XML for the access - for example,
if instead it issues a redirect due to authorisation failture - then the flash script hangs.The user will not see the "unauthorised access" page be rendered, they are left with
no feedback about what went wrong.It seems this would need to be rectified with a failure callback on the URLLoader that issues the request ... at the moment there is no provision for this to fail gracefully.
Meanwhile - developers beware: the s3_uploads_controller must be available for general access. Best to give it a skip_before_filter on any authorisation controls on your app.
Comments
GreenAsJade Sun May 10 02:57:28 -0700 2009 | link
Dang - it's a bit sad that s3_uploads_controller is a file generated by the plugin, so it's hard to see how there will be an elegant way to make sure the developer installing this plugin doesn't forget this step... I'm almost inclined to put a skip_before_filter statement at the top of the s3_uploads_controller that will die with an error till the developer fills in the right function!
GreenAsJade Tue May 12 05:10:55 -0700 2009 | link
I've put this into my fork.
-
my flash-fu sux - but it'd be awesome to fire the selected callback with filename and size, or even a hash with everything known about the file. calling with a hash would future protect the interface. anyone have any idea how hard this'd be?
Comments
Please log in to comment. -
How are you avoiding 201 response errors and still obtaining response data?
1 comment Created about 1 month ago by praveensharmaWhat it says on the tin. I'm trying to roll my own non s3 swf_uploader which hits an api directly (Soundcloud.com). Unfortunately, when the 201 error is thrown, I do not receive the response data (URL for the target upload). How are you doing this? I'm a flash coder by day and don't actually see anyway to avoid the IO Error and receive the data. I also can't have Soundcloud send a 200 response.
Comments
Can you please contact us directly at info@elctech.com?
Thanks.
I've made a fork that has this change, and other improvements.