I tried your answer, but i have a signup page in which user fill his details like username, emailaddress etc and also add an image. So how this possible with one form tag.
and also i have put my Rest URl there, but how can i save the image.
Do we need to save the image in database and if yes, what is the datatype we need to create and also what about retrieving the image.
ashishmittal
Member
9 Points
17 Posts
Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 07:30 AM|LINK
HI
I want to upload/download the file using Html5 with jquery(Xmlhhtprequest) and Rest service with no ASPX page, only there are simple html pages.
i tried it to upload the file through xmlhttprequest but not able to get sucess that how the image save on server and download from server.
Can anyone tell me how can i achieve this?
and also provide any exapmple with that.
i am really thankful to you.
With best Regards,
Ashish
REST xmlhttprequest JQuery
asteranup
All-Star
30184 Points
4906 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 07:34 AM|LINK
Hi,
You can check this post-
http://www.matlus.com/html5-file-upload-with-progress/
Instead of using the aspx page as uploader file you can try-
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
ashishmittal
Member
9 Points
17 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 08:04 AM|LINK
First thanks for your valuable reply.
I tried your answer, but i have a signup page in which user fill his details like username, emailaddress etc and also add an image. So how this possible with one form tag.
and also i have put my Rest URl there, but how can i save the image.
Do we need to save the image in database and if yes, what is the datatype we need to create and also what about retrieving the image.
and if any another solution plz tell me.
i am really oblidge to you.
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 08:50 AM|LINK
Hi,
Check the below link!
http://stackoverflow.com/questions/297954/uploading-files-with-asp-net-mvc-get-name-but-no-file-stream-what-am-i-doing
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
ashishmittal
Member
9 Points
17 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 10:56 AM|LINK
Sorry ,but we can't use Form collection in the Rest Service.
My purpose is to save the file on the server.
raju dasa
Star
14396 Points
2449 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 09, 2012 01:29 PM|LINK
Hi,
check this site:
http://www.strathweb.com/2012/04/html5-drag-and-drop-asynchronous-multi-file-upload-with-asp-net-webapi/
REST xmlhttprequest JQuery
rajudasa.blogspot.com || blog@opera
asteranup
All-Star
30184 Points
4906 Posts
Re: Download/upload file using HTMl5 with jquery(Xmlhttprequest) and Rest Service
May 10, 2012 03:48 AM|LINK
Hi,
Not sure what kind of rest service you are using. But you may have some idea here-
http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/uploading-a-file-using-wcf-rest-service/
http://code.msdn.microsoft.com/windowsdesktop/Upload-files-using-a-REST-13f16af2
http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
http://stackoverflow.com/questions/664712/restful-wcf-service-image-upload-problem
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog