0

I am using http://valums.com/ajax-upload/ File uploader plugin to do ajax image upload and i see the request in fiddler go through, with the image in it when i pick a local image. The fiddler request has the PNG file in it.

From fiddler -

POST http://localhost:16169/client/account/uploadimage/202?qqfile=logo_l.png HTTP/1.1
Host: localhost:16169
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
X-File-Name: logo_l.png
Content-Type: application/octet-stream
Referer: http://localhost:16169/client/events/edit/202
Content-Length: 32660
Pragma: no-cache
Cache-Control: no-cache

�PNG

���
IHDR�����������¯�C���gAMA����
�a���   pHYs�����&�?���tEXtSoftware�Microsoft Office�5q��IDATx^��G�=���8,����@p
�ݓ�@�$��������.+��T���H���ϗ}��<��ܹsgg�O�����6111A���A2�@J�%�K!��K��)����ζ)�Mm��@�{�;ˤ�
ˤt�d���FK���og�Ц�6�a �=�eR�?�eR:m2�@J�%�F���m
hS@��0�����2)��2)�6b �ђa����6�)�MvHv�og���Oa��N�1��hɰ���l���&;$����L����LJ�M�Hi�d�h�v�Mm

I have truncated the request but you get the idea that the image is being transmitted in the post body.

But when i do

var image = WebImage.GetImageFromRequest();

in the controller that handles this post request. Image comes out to be null, Looking at the debugger all other values are present.

Request.Files.Count = 0 

as well.

Anyone gone through this, or can help me debug this will be greatly appreciated. Thanks.

1 Answer 1

3

Found the solution..

 WebImage image = new WebImage(Request.InputStream);

instead of -

var image = WebImage.GetImageFromRequest();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.