iDevApps

Full Version: Multiple File Uploads to CocoaHTTPServer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. Can somebody please help me.. I have managed to figure out how to upload a single file onto my iPhone app using CocoaHTTPServer but I have no idea how to upload multiple (concurrent) files onto the iPhone via a web browser.

I've had a bit play with JavaScript drag and drop and I've gotten my head around how to load files within the (client-side) script.. how to identify the names of the files that have been drag/dropped etc.. but how do I take all of these files and 'post' them to the CocoaHTTP web server running on my iPhone?

I read somewhere that JavaScript doesn't support file upload to the server. Is this true? Is there some sort of additional 'glue' technology that I require? I'm not very familiar with web development - I'm mainly an application developer so this is all rather new to me.
(2014.01.21 04:37 AM)SparkyNZ Wrote: [ -> ]Hi. Can somebody please help me.. I have managed to figure out how to upload a single file onto my iPhone app using CocoaHTTPServer but I have no idea how to upload multiple (concurrent) files onto the iPhone via a web browser.

I've had a bit play with JavaScript drag and drop and I've gotten my head around how to load files within the (client-side) script.. how to identify the names of the files that have been drag/dropped etc.. but how do I take all of these files and 'post' them to the CocoaHTTP web server running on my iPhone?

I read somewhere that JavaScript doesn't support file upload to the server. Is this true? Is there some sort of additional 'glue' technology that I require? I'm not very familiar with web development - I'm mainly an application developer so this is all rather new to me.

Javascript doesn't handle anything other than hiding the HTTP POST code.

Look up forms in HTTP. That will show you what is really happening on the back end.

Look for the SimpleFileUploadServer project in the Samples directory of CocoaHTTPServer.
Reference URL's