Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 21
Registered: ‎12-25-2011
My Device: Playbook
My Carrier: No mobile

Help needed with uploading an audio file to server

Hello everyone,

 

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!

Highlighted
Developer
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook
My Carrier: Rogers

Re: Help needed with uploading an audio file to server

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".

Contributor
Posts: 21
Registered: ‎12-25-2011
My Device: Playbook
My Carrier: No mobile

Re: Help needed with uploading an audio file to server

For some strange reasons, I feel like we are doing similar kind of work......

Developer
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook
My Carrier: Rogers

Re: Help needed with uploading an audio file to server

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?