Closed mattheworiordan closed 10 years ago
This feature request is the exact same request i was going to ask for. I have a problem with setting up s3 where i cannot rename the files that customers are uploading form my site. My database renames files in a certain way to prevent same-name files and also to organize the database, and i need users to upload the files directly to s3 and have the same namign scheme as what the database would use.
Me too. It would be great if this is possible.
I would also really like to have this ability. The current state of this plugin is that you have to specify all that information when the SWF is initialized. The side effect of this is that you can only have one uploader initialized per page. I ran into a situation where I had a list view and needed to initialize a separate uploader for each item, but this plugin was not flexible enough to handle that situation so I had to come up with a different solution. It would be great if you didn't have to specify any details except maybe the button image when it is initialized, then before the uploading starts, you could fill in the blanks specific to the file(s) that are about to be uploaded. I found some other Amazon S3 uploaders that work like this (and are Sinatra compatible) but I ended up not being able to use them. If this library could support this feature, it would be much appreciated. =]
I have added the functionality to change the filename and keyprefix a while ago, but I have changed the uploader so much and customized it specific to my website that it probably would not help much if i posted my code. Here is what you need to do:
uploadoptions.FileName = UniqueID + "" + upload_options.OriginalName;
or
upload_options.key = prefixPath + UniqueID + '/' + upload_options.FileName;
hope this helps.
Thanks, @AdnanTheExcellent for the solution!
Hi Nathan
Love this plugin btw, you have really saved the day for me today...
One thing that would be really nice however would be to allow a filename & keyPrefix to be explicitly set for the SwfUpload object after it's been initialized. The reason I need this is as follows:
Not sure how difficult this would be, but I think it would add a lot.
Thanks, Matthew