Uploading a file... Yes, another post, and a minor rant

Sorry guys, for putting out another post on uploading files to a web server, but you’ll see why I felt I had to.

I’m just trying to upload a file to my webserver, which currently expects multipart form data. I’ve seen some people mention a lua library to help with that, and I’ve seen some links to some code examples, but…

In almost every case, the link is broken.

This is mainly because Corona’s old code repository was shut down, but Google doesn’t know that.

Example result:

How To - Upload an Image to a server (multipart/form-data)

https://developer. corona labs.com/category/tags/http

 
Generates multipart form-data suitable for use with Corona SDK’s network.request(…) function. Updated 2011-10-29: Added some server side example code.

https://developer.coronalabs.com/category/tags/http

“Hey, that sounds like exactly what I need!” 

However, if you go to that link, it takes you to the new code repository site, and that sample doesn’t exist there.  It’s happened to me so many times today, it’s just ridiculous.

Thanks,

Dave

Hope this helps (not broken): http://coronalabs.com/blog/2014/02/25/tutorial-uploading-files-demystified/ 

Maybe it would be a good idea for us to find cached versoons of these pages (via wayback machine) and put them up (the code) on github.

I still think the old code exchange should have been left open for browsing, just closed for new entries.

It had been closed for new entries.  If you find these things, please post then in the new code exchange.  It uses gists and github to manage the code.  I’ll suggest to the team about re-enabling it, but it had been quite a while since we moved and we can’t keep old systems up forever.

Rob

@roaminggamer, did you mean to paste a link that didn’t work to mock me?!  If so, well done!  :-)  I assume it was accidental, but there are some extra characters in the link that make it fail.

I’d already seen that post, though.

It says this:

Most existing scripts that accept file upload probably won’t work withnetwork.upload() because they’re looking for an HTTP POST form-based MIME multi-part upload format. Corona’s network.upload() API  does not talk to these kinds of scripts, but we’ll discuss this further in a bit.

I’m looking to do exactly that – multipart form data.  :-(

Sorry boss.  Missed that, and I think the link got messed up by the forums parser.  I grabbed it directly from the address bar in Chrome.

:frowning:

I finally got this to work, by the way. I could never figure out multipart form data, but I rewrote my asp.net web api controller to support an HTTP PUT. So if anyone needs to know how to do that, let me know.

Hope this helps (not broken): http://coronalabs.com/blog/2014/02/25/tutorial-uploading-files-demystified/ 

Maybe it would be a good idea for us to find cached versoons of these pages (via wayback machine) and put them up (the code) on github.

I still think the old code exchange should have been left open for browsing, just closed for new entries.

It had been closed for new entries.  If you find these things, please post then in the new code exchange.  It uses gists and github to manage the code.  I’ll suggest to the team about re-enabling it, but it had been quite a while since we moved and we can’t keep old systems up forever.

Rob

@roaminggamer, did you mean to paste a link that didn’t work to mock me?!  If so, well done!  :-)  I assume it was accidental, but there are some extra characters in the link that make it fail.

I’d already seen that post, though.

It says this:

Most existing scripts that accept file upload probably won’t work withnetwork.upload() because they’re looking for an HTTP POST form-based MIME multi-part upload format. Corona’s network.upload() API  does not talk to these kinds of scripts, but we’ll discuss this further in a bit.

I’m looking to do exactly that – multipart form data.  :-(

Sorry boss.  Missed that, and I think the link got messed up by the forums parser.  I grabbed it directly from the address bar in Chrome.

:frowning:

I finally got this to work, by the way. I could never figure out multipart form data, but I rewrote my asp.net web api controller to support an HTTP PUT. So if anyone needs to know how to do that, let me know.