homepage Welcome to WebmasterWorld Guest from 23.23.9.5
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Jpeg displaying as base64 string
When programaticallly posting a form
Snookered

10+ Year Member



 
Msg#: 3438 posted 6:39 am on Jun 19, 2004 (gmt 0)

Hi

I'm programatically posting an image using multipart/form-data. It sends to the server OK, but when I try to view it in the browser, it is still in the base64 string I sent it as: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUG etc....

I've been through the form I built over and over:

string PostData = "";

PostData += "-----------------------------7d41fb3081216";
PostData += "\r";
PostData += "\n";

PostData += "Content-Disposition: form-data; name=\"userfile\"; filename=" + "\"c:\\temp\\" + "myimg.jpg\";";
PostData += "\r";
PostData += "\n";

PostData += "Content-Type: image/jpeg; name=\"myimg.jpg\";";
PostData += "\r";
PostData += "\n";

PostData +="Content-Transfer-Encoding: binary;";
PostData += "\r";
PostData += "\n";
PostData += "\r";
PostData += "\n";

string a = Convert.ToBase64String(imagefile); //imagefile is a byte array
PostData += a;

PostData += "\r";
PostData += "\n";

PostData += "-----------------------------7d41fb3081216--";

I've tried pretty much every order of mimes, but still the image isn't sent properly. Does anyone have any experience of this or what could be causing the base64 string to persist like that?

Thanks

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved