Now I have to convert this content and save it according to file extension..
Please help me . .
thanks in advance. .
Please Indicate "Mark as Answer" if a Post has Answered the Question
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
I am getting error in - // Convert the Base64 UUEncoded input into binary output.
error - "Invalid character in a Base-64 string."
Please Indicate "Mark as Answer" if a Post has Answered the Question
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
ignatandrei i am using same link given by you and i am passing a pdf file which has some images and texts...
Please Indicate "Mark as Answer" if a Post has Answered the Question
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
ignatandrei your link worked but I am having some decoding problems. New pdf file gor created and its currupeted/damaged.
Its not opening. . .How do I debug this ??
Please Indicate "Mark as Answer" if a Post has Answered the Question
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
SameerKulkar...
Member
195 Points
110 Posts
Encoding and decoding a file to base64 .
May 07, 2012 07:30 AM|LINK
Hi guys,
I have this situation.
XML has file content in base64 encoded string format and i know the file extenstion
<file_extension>.pdf</file_extension>
<file_content>base64_encoded_string</file_content>
Now I have to convert this content and save it according to file extension..
Please help me . .
thanks in advance. .
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
ignatandrei
All-Star
134521 Points
21576 Posts
Moderator
MVP
Re: Encoding and decoding a file to base64 .
May 07, 2012 07:35 AM|LINK
http://msdn.microsoft.com/en-us/library/system.convert.frombase64string.aspx
SameerKulkar...
Member
195 Points
110 Posts
Re: Encoding and decoding a file to base64 .
May 07, 2012 09:44 AM|LINK
Hi,
I am getting error in - // Convert the Base64 UUEncoded input into binary output.
error - "Invalid character in a Base-64 string."
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
ignatandrei
All-Star
134521 Points
21576 Posts
Moderator
MVP
Re: Encoding and decoding a file to base64 .
May 07, 2012 10:55 AM|LINK
then maybe it is not base 64... I have tested many times the encoder / decoder with success...
bhaskar.mule
Contributor
2264 Points
656 Posts
Re: Encoding and decoding a file to base64 .
May 07, 2012 11:00 AM|LINK
XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath("~/Xmlfile/XMLFile.xml")); strXML = doc.OuterXml; byte[] cartBytes = System.Text.Encoding.Default.GetBytes(strXML); strEncoded = Convert.ToBase64String(cartBytes);Site:Rare technical solutions
SameerKulkar...
Member
195 Points
110 Posts
Re: Encoding and decoding a file to base64 .
May 07, 2012 11:40 AM|LINK
ignatandrei i am using same link given by you and i am passing a pdf file which has some images and texts...
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
SameerKulkar...
Member
195 Points
110 Posts
Re: Encoding and decoding a file to base64 .
May 07, 2012 11:48 AM|LINK
ignatandrei your link worked but I am having some decoding problems. New pdf file gor created and its currupeted/damaged.
Its not opening. . .How do I debug this ??
-----------------------
Sameer Kulkarni.
Programmer Analyst @ mnop.in
My blog - http://geekospace.com/
-----------------------
ignatandrei
All-Star
134521 Points
21576 Posts
Moderator
MVP
Re: Encoding and decoding a file to base64 .
May 07, 2012 12:36 PM|LINK
Speak with the people that gave you the base 64 encoding and tell to provide you the pdf. Then compare the decoding with the original