I have a complicated need for this software and I thought before I spent forever working on the solution to find there was none, I would ask the creator and community if there was an easy solution.
I have a dedicated server that the form with SWFUpload is on. I want for users to go to that form, be able to upload directly to Amazon S3 via POST, but for my server to know that uploads have taken place. Right now SWFUpload uploads files to "upload.php" on my dedicated server which then sends the files to Amazon. I do this so I can log in the database that an upload has taken place and I log the name of the file.
Is it possible to submit in two directions or maybe I'm thinking about this all wrong.... Hopefully I've explained what I'm trying to do here well enough.
Thanks!
S3
I did a quick scanned of the S3 documentation. It migh work from SWFUpload, but you will probably have some problems:
1) you can't use the redirect S3 parameter on non-windows clients. Flash Player will crap out, in fact it might not even work on windows clients
2) It says S3 returns an empty document. This probably means the flash v9 version won't work (in it's current form). Well, from S3's point of view it will work but SWFUpload will never fire the uploadSuccess event. The Flash 8 version won't work except you can't send all those extra POST values you need.
You could tweak the v9 SWF source code to use the UPLOAD_COMPLETE event rather than UPLOAD_DATA and it will probably work for you (you still can't use redirects).
Anyways, assuming uploading a files works I would then use AJAX in the uploadSuccess or uploadComplete event to make a call to your server to make the database update.
Nirvanix
If you're tied to S3, you're probably in for headaches doing direct-to-s3 http uploads via flash, at least until they improve their model.
In the meantime, it's a touch more expensive, but Nirvanix is an S3 competitor and is a bit easier to work with... and they support flash & browser uploads.
You can use the uploadSuccess trigger to send your server an ajax notification (to log in your database).
Thanks!
I guess I'll just keep the form I'm using for now for the photos. I may go with a direct form upload for videos instead of using swfupload. I bet if I learn more about EC2 I can upload to an EC2 instance that stores the files in S3 and then does a db update to my remote db server. Probably a good idea in either case.
Thanks for the input andjules. Probably going to stick with either S3 or go with someone like Mosso though.
Thanks again and swfupload is awesome!
For anyone else struggling
For anyone else struggling with S3 uploads you may find this helpful: http://blog.deskcaster.com/2008/05/08/flash-based-uploads-to-amazon-s3/