I want to retrieve the file data in jquery and upload this to aspx page. I have read about the html5 way of doing this but want to know how to do this old browser(not supporting html5).
-
Actually I want to upload a file with ajax and don't understand how to do this with ajax. Do you have any idea.azam– azam2013-01-26 12:17:14 +00:00Commented Jan 26, 2013 at 12:17
-
give me the answer instead voting down. What is this?azam– azam2013-01-26 12:32:54 +00:00Commented Jan 26, 2013 at 12:32
-
user, I think the downvote means you need to elaborate on what you are trying to achieve, and what issue you are facing in an understandable way for people to help you.Rohith Nair– Rohith Nair2013-01-26 12:42:38 +00:00Commented Jan 26, 2013 at 12:42
-
Ok... This is nice info thanks... will take care next time.. It seems very rude when someone votes down without telling you what is wrong with the question.azam– azam2013-01-26 13:01:56 +00:00Commented Jan 26, 2013 at 13:01
-
I also did not vote down :). But please read your question again, it took so much time to understand the question. If you could have edited it to just the point; this could have been much easier. "I want to retrieve the form data in javascript" but your actual question was to File upload in ASP.NET using AJAXRohith Nair– Rohith Nair2013-01-26 13:04:20 +00:00Commented Jan 26, 2013 at 13:04
|
Show 2 more comments
3 Answers
Found same question
9 Comments
azam
I mean file data in form... I want the binary data of file that has to be uploaded..
azam
Yes this is already open on in my browser but this is specific to moz only.
catherine
I found this same issue stackoverflow.com/questions/7529159/…
azam
edit the answer and mention the link up there so I shall mark it as answer. and please vote up. why people here vote down with out helping.
catherine
No, I did not vote down your question. I'm here to share what I have learn
|
Do you just want to read through javascript or do you want to upload? Have a look at :https://stackoverflow.com/questions/5397991/html-4-equivalent-of-html-5s-filereader for accessing file data.
If it is just about posting file to server using ajax, then you can use jquery plugin (easy way) or write ajax request through javascript to post details.
5 Comments
azam
Yes my issue actually is to upload the file through ajax. but I am curious about the process too. Just to understand it for the future use.. and actually how the JQuery Api retrieves it?
Rohith Nair
Retrieves it in the sense? Sorry do you want to understand whether it is scalable across other projects or something like that?
azam
I mean how the data of the file is sent with ajax? Only html5 has a way to retrieve the binary of the file and send it with ajax request? However, how to retrieve the file binary data with javascript or jquery?
Rohith Nair
I think I got confused. If you just want to create a form and receive file data to aspx page on submit click; I think this is a good starting point codeproject.com/Articles/1757/File-Upload-with-ASP-NET
Rohith Nair
Hi, I have used this in my project once evolpin.wordpress.com/2011/09/11/… .There are several other tutorials based on this. Hope this helps
Maybe Uploadify is your friend here... have a read of this for more info http://markp3rry.wordpress.com/?s=uploadify&submit=Search
2 Comments
azam
Thanks... Can you explain the internal working of how the file is sent via ajax request. I don't understand how the file is sent via ajax.
markp3rry
You need to set something up on your server to process the file (could be a generic handler in .net or a php script). You make a jQuery ajax call as specified on the link I gave you and this passes the file data in a stream to the handler on the server. Uploadify does the async progress bar bit (and I had to render it in an iFrame to get it to work).