views:

317

answers:

3

We are making an automated patching application and would like to post files on production server through asp.net page (or maybe a web service), since we can only access production server via http. The page should accept files and store them to appropriate location. The path to files will be declared in external XML file. So, is it possible posting a base64 encoded files within body tag and HOW? maybe even any better approach?

+1  A: 

Hi,

If you plan to use Base64 encoding. Take a look at

  System.Convert.ToBase64String()
  System.Convert.FromBase64String()
  System.Convert.ToBase64CharArray()
  System.Convert.FromBase64CharArray()
labilbe
+1  A: 

why not create a webservice which accepts an object like:

class postfile { public byte[] fileByte; public string fileName; }

Then add a web reference in your client app.

.net will serialize the object for you.

You will need to secure this using wse security and might require the service use impersonation to write the file on the server.