0

When trying to implement Aspose sample code below I'm getting System.UnauthorizedAccessException because it's trying to save to a forbidden directory.

I have a known server path to output this file correctly, but I didn't find how to setup Aspose on this server path. How can I set the output directory?

    public JsonResult ConvertPDFtoXLSX(FormCollection formCollection)
    {
        var inputFile= Request.Files[0];

        // load PDF with an instance of Document                        
        var document = new Document(inputFile.InputStream);

        // save document in XLS format
        document.Save("output.xlsx", new ExcelSaveOptions());

        return Json(new
        {
            success = true,
        }, JsonRequestBehavior.AllowGet);
    }
rd1218
  • 134
  • 12
  • It is nice to know that your issue has been resolved. Please note that such issues and discussions about Aspose APIs are recommended to be posted in dedicated Aspose Support forum (https://forum.aspose.com/). We request you please create a topic there in case you need any kind of assistance in the future. This is Asad Ali and I work as Developer Evangelist at Aspose. – Asad Ali Jul 26 '23 at 21:37

1 Answers1

0

Solution was simply replace "output.xlsx" with the complete server path (filename included).

rd1218
  • 134
  • 12