how can i upload an image (javascript) to a backend server (MVC4) and in the same post also add some custom data.
The problem we are facing is that we are trying to make an album web client much like facebook’s albums.
A user will upload a series of photos to be added to a database. We need to have those photos already taged to an album as facebook’s photos cannot be viewed without having an album who owns the photo.
I talked to the guy in charge of the front end and he says that while doing the javascript call to upload a photo, you cannot also send meta data within this call.
Thank you for your help.
Sure you can.
When you upload your file reference, just add some post variables to the URL.
like
upload.aspx?title=blah?date=somedate
the actual data is just part of the form data as specified by the HTTP protocol
http://www.vivtek.com/rfc1867.html
A great tool is AjaxUpload it should be a good starting point. If you need to upload data along with it, add query variables to the “action”