• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Receive an image posted to webpage

How do I receive an image posted to my ASP.NET website over an http request?

I'm not sure if I need to use a Web Service or if I can simply use an aspx page and get the image from the Request.QueryString?

my site is an ASP.NET (VB)
0
BrianFord
Asked:
BrianFord
  • 2
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Neither one really.  You have to create a form page and a page to receive the form data.  Here is a Microsoft article on the subject: https://support.microsoft.com/en-us/kb/323246
0
 
BrianFordAuthor Commented:
Thanks but the link explains how to do it using a form where the user is selecting a local file and clicks an upload button.

The image file I need to receive is being posted to my site (actually from an iOS device) so I need to receive and process that file and return 'success' or 'fail'
0
 
Dave BaldwinFixer of ProblemsCommented:
As far as I know, there is no other method to do that on a web page.  Click on "Request Attention" to get others to look at your question.
0
 
ArkCommented:
You can use both methods (though QueryString limit depends on browser - from 2K in IE up to 100-200K for others. IIS accepts 16K). Plus you can post data with HTTP Post request.
If images are small use query string with base64 encoded image bytes. Create empty Page on your server and call it like: pageAddress?imageData=base64encodedstrin, then convert string back to byte array in Form_Load and save to disk. Write to response "Upload OK" or "Fail" depending to results.
For large images use WebService or POST - in this case you can use either base64 string or byte array.
See example here http://stackoverflow.com/questions/9889332/using-asmx-file-for-uploading-image-from-iphone
0
 
BrianFordAuthor Commented:
Thanks
Managed to get this working and posting to a Web Service
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now