How to prompt user before saving the ppt to the specified location

Hi,

Is there any way to save the ppt after giving a prompt to the user to choose the location.

When I write
pres.Save(path + “output.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);
It goes to the predefined path.

or

FileStream toStream = new FileStream(“c:\” + “output.pptx”, FileMode.Create);
pres.Save(toStream, Aspose.Slides.Export.SaveFormat.Pptx);

It is trying to access the local path.

Instead I want give user a dialog to choose the location to save the file.

Please help.

Thanks.

@sayakg,

I have observed your comments. I have shared a piece of code in a text file with you. This will help you to achieve your requirements. Also please visit this SaveFileDialog article. Please share feedback with us if there is still an issue.

Best Regards,

Adnan Ahmad
File Location.zip (413 Bytes)

Hi Adnan,

I am not able to download the zip as it shows error page.

Could you please confirm I can use SavefileDialog into SharePoint site collection without any issue.

Thanks.

@Adnan.Ahmad,

Could you please share the piece of code in this regard on how to show the save dialog to the user while downloading the newly created ppt from web app (pres.Save).

Appreciate your support.

Thanks.

@sayakg,

I have shared file over this dropbox link for your reference. Can you please try downloading it.

Many Thanks,

Mudassir Fayyaz

@mudassir.fayyaz

I have got unfortunately the following error while give a click to the dropbox link.
You can share the piece of code here only if you think it is suitable. Thanks.

Error (429)
This link is temporarily disabled. The person who shared it hit their daily limit of traffic or downloads. Learn about traffic limits.

@sayakg,

Please try using following sample code on your end.

SaveFileDialog mySaveFileDialog = new SaveFileDialog();
mySaveFileDialog.Filter = "PPTX Files|*.pptx"; // optional filter to restrict file types
if (mySaveFileDialog.ShowDialog() == DialogResult.OK)
{
    string selectedFileName = mySaveFileDialog.FileName;
    // do whatever you like with the selected filename
    pres.Save(selectedFileName, Aspose.Slides.Export.SaveFormat.Pptx);
} 

Many Thanks,

Mudassir Fayyaz

@mudassir.fayyaz,

Thanks for your help.

Actually I am using web application to download the ppt while click on the download button. As a result I am not able to use SaveFileDialog.

Is there any thing I can use Aspose.Slides.Export.isaveoption or using “HttpContext.Current.Response”.

Please advise.

Best Regards.

@sayakg,

I have observed your requirements and like to share that you can export to HttpReponse when saving presentation in a web application. Please visit this API reference page link for your kind reference in this regard.

Many Thanks,

Mudassir Fayyaz