I am having problem with accessing (Open) file which exists on server and need to Save after writing data at same time. I am using following syntax and it is giving path is not valid error.
Exact error is “The given path’s format is not supported.“
Workbook workbook = new Workbook(”https://www.test.com/Reports/book1.xlsx”);
With Memory Stream object i am able to access that file but again i am not sure how to save after writing data in it.
MemoryStream ms;
Workbook workbook = new Workbook(ms)
For Saving i don’t know the exact code.
Can anyone help me in opening file on server writing data in it and after writing data save same file onto server(that path).
Well, there is no such constructor of Workbook class that could read data from a url, rather you got to get into streams and then open the Workbook based on the streams. Aspose.Cells supports to read data from streams and also supports to save data to streams. Please see the sample code on how to get a file from a url and save to streams, then use Aspose.Cells APIs to open a new Workbook based on the streams for your reference:
e.g
Sample code:
string URL: "http://xxxxx/file1.xlx";
WebClient Client= new WebClient();
MemoryStream stream = new MemoryStream(Client.Download(URL));
Workbook book = new Workbook(stream);
//…
//Your code goes here to input data into the worksheets cells.
//…
Similarly you may save your final workbook data to streams and then use your own .NET code via using .NET APIs to save the file onto the server based on the final streams of the workbook data.
Thank you.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.