Search code examples
javascriptamazon-s3uploadify

Uploadify question mark in filename not working


I'm using uploadify + s3, and when trying to upload a file that has question marks in it, Uploadify doesn't give me the correct filename. For example, if the file is named #?? (copy).mp4, the fileObj.name value sent to the event handlers is # (basically everything after and including the question mark is removed).

  1. Ignoring the original filename altogether is not an option, because I also need the extension.
  2. If I try to change the scriptData at runtime, the upload will fail for some reason.

Can you help me out with this issue?


Solution

  • The problem exists above uploadify in actionscript's FileReference object.

    From what I can tell the FileReference object chops the name at the question mark and only returns the part in front it.

    I tried finding some way of getting to the original filesystem file name before it populated FileReference(event.target).name but I have next to no knowledge of actionscript.

    I've also thought about renaming on the server but no mime type is set when the file is uploaded due to how `FileReference' handles the filename. I think it throws away the file ext since it's after the question mark.

    I looked into hacking the uploadify Javascript to deal with file name validation and sanitization client side or send something to the server so the name can be fixed when the file is processed but by by the time uploadify has access to the name it's been truncated.