Reputation: 165
I am trying to insert my data in to xml file. the xml file location
path: http://AutoCompleteInGridView%20new1/Design/Pro/pricelist.xml
.
when inserting my data i got error URI formats are not supported
.
It shows argument exception was unhandled.I want to save my xml
file in server system
.these url belongs to ServerPath location.
can anyone give me a suggestion or links to solve these problem.
here is the error:
Upvotes: 4
Views: 26233
Reputation: 61
you could try with this solution:
Basically, use
doc.Save(Server.MapPath("~/EEPPriceList/Products.xml"))
Upvotes: 0
Reputation: 1
Try like this:
string SavePathUrl = ConfigurationManager.AppSettings["SavePathUrl"];
string strFileName = DateTime.Now.ToString("dd-mmm-yyyy-hh-mm-ss-ffffff") + "^" + fileName;
File.WriteAllBytes(new Uri(SavePathUrl).AbsoluteUri + strFileName, Convert.FromBase64String(base64String));
return strFileName;
Upvotes: 0
Reputation:
Use this sample:
string uriPath = "YourAddress/pricelist.xml";
string localPath = new Uri(uriPath).LocalPath;
Upvotes: 2