Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Fri Feb 05, 2021 4:08 pm

Hi Team,

I am getting error while doing ppt.SaveToFile(destinationTempFile, FileFormat.Pptx2013); And the error is as below:
The filename, directory name, or volume label syntax is incorrect. : 'C:\\<solutionpath>\\<myfileBloburl>'

Thanks in advance for your support.
Here is my code.

//sourcepath - My file 1 blob url (Means file present in azure blob)
//[streamUrl - stream of sourcepath]
//destinationPath - My file 2 blob url (Eg: http://dummyrul.com//dummyFolder//testfile.pptx)

Presentation ppt = new Presentation();
ppt.LoadFromStream(streamUrl, FileFormat.Pptx2013);
ISlide slide = ppt.Slides[0];
slide.ReplaceAllText("MyTitle", "UpdatedTile", false);
ppt.SaveToFile(destinationPath, FileFormat.Pptx2013);

- Here, when calling .SaveToFile i'm getting error as 'The filename, directory name, or volume label syntax is incorrect. : 'C:\\<solutionpath>\\<destinationPath>'

saleembaigmirza
 
Posts: 21
Joined: Fri Nov 13, 2020 4:15 pm

Sun Feb 07, 2021 3:45 am

Hello,

Thanks for your inquiry.
Sorry that our Spire.Preseatation supports saving files to a local path, but does not support saving to a URL. You can refer to the following code to save the PPT file to a stream. Then you write the stream to your network URL.
Code: Select all
            Presentation ppt = new Presentation();
            ppt.LoadFromStream(streamUrl, FileFormat.Pptx2013);
            ISlide slide = ppt.Slides[0];
            slide.ReplaceAllText("MyTitle", "UpdatedTile", false);
            MemoryStream stream = new System.IO.MemoryStream();
            ppt.SaveToFile(stream, FileFormat.Pptx2013);

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Feb 09, 2021 7:04 am

Hello.!
Thanks for your support.

saleembaigmirza
 
Posts: 21
Joined: Fri Nov 13, 2020 4:15 pm

Tue Feb 09, 2021 8:10 am

You are welcome.
If you encounter any issues related to our products in the future, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Presentation