Base64 Encode - Decode Python and ASP.Net?
<p>i m trying encode data on python with "base64.encodestring()" then i send encodedData to my asp.net service and trying decode this data.But this data is invalid.</p>

<p>Python function code () : </p>

<pre><code>randomString=''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10))
fileNameString=randomString+"_"+request.vars['file'].filename
pathToFile="/tmp/"+fileNameString
f = open(pathToFile,"wb")
f.write(request.vars["file"].file.read())
f.close()

f = open(pathToFile,"rb")
data=f.read()
f.close()
encodedData=base64.encodestring(data)

return encodedData
</code></pre>

<p>C# Code:</p>

<pre><code>byte[] filebytes = Convert.FromBase64String(encodedData);
FileStream fs = new FileStream(crmPath + fileName,
FileMode.CreateNew,
FileAccess.Write,
FileShare.None);
fs.Write(filebytes, 0, filebytes.Length);
fs.Close();
</code></pre>

<p>this codes works towards save file but when i try to open this file it isnt opened</p>
