Would someone be able to tell the easiest way to upload an image file to a server?
03-20-2013, 07:58 PM
03-20-2013, 08:14 PM
03-21-2013, 12:57 AM
Are you using AJAX to upload the file, or a regular form that submits to an ASP page?
There is a ninja technique in order to do this, it is not intuitive. I won't get into it unless necessary.
The "action" attribute tells the form where to upload the file to. The "enctype" attribute can be used to upload a file by putting "multipart/form-data" as the value. Example:
Change "/path/to/file.aspx" to your asp program that uploads files. You can put other data in this form, too- not just files. I don't know how to actually write the ASP code for uploading but I'm sure googling "ASP.net upload file" will tell you everything you need, including repeating what I just said about the form.
03-21-2013, 02:51 PM
files are not a post param, they are in a different collection.