01-11-2012 12:52 PM
I am trying to upload an audio file from playbook(local) to my server without user's interaction.(i.e. Can't use form type=file)
I have been trying to use the Upload/DOwnload Extension others have suggested.
It turns out I am just stabbing in the dark and simply can't get it to work!
The sample program provided by above link simply shows me how client code should call the upload function, but it has no explanation what server side must do to receive the file.
In description of upload function:
statid void upload(remotePath, localPath, onProgress, onError, options); // Uploads the local content to the remotePath - remotePath points to a server side script (e.g. a PHP file) that knows how to handle the upload, the script will have full control of the file's destination
Could someone please give me an example of such server side script? Or at least direct me to the relevant information so I can read and learn?
What should server side do? What should "remotepath" look like?(i.e. "serverAddress/directoryForUpload/"
or "serverAddress/upload.php" or "serverAddress/directoryForUpload/receivedFile.wav ) I have been looking around and I can't find a clue.
I have been stuck on this issue for a week and I really really need to solve this soon. Please help.
If I can't really solve this using webworks. Would you suggest me to try to accomplish this by trying to write my application with AIR?
Appreciated!! Please help!
01-21-2012 11:18 AM
I think the tutorial How to create an application to Download and Upload files should provide all the instruction you need.
There are definitely limitations, though. You can't set custom headers in your outbound request, or append form data, or name the file element to anything other than "file".
01-21-2012 11:36 AM
I think we are too! I'm putting together a proof of concept of a speech recognition WebWorks app. I assume you're doing the same?