- Home
- Forum
- ASP.NET MVC
- Access to the path is denied.
Access to the path is denied.
|
WebKitConverterSettings webKitSettings = new WebKitConverterSettings();
webKitSettings.TempPath = "D://Project/Temp"; |
Hello Prakash,
the temp folder has elevated permissions, so it cannot be a problem.
It is interesting, this problem only occurs occassionaly (not in case of all conversion) and not in all the devices.
Hello Prakash,
the temp folder has elevated permissions, so it cannot be a problem.
It is interesting, this problem only occurs occassionaly (not in case of all conversion) and not in all the devices.
I have exactly same problem
Access to the path 'C:\inetpub\wwwroot\SourceCode\PublishWeb\Content\webkit\6ebd0dd8-4216-42fa-a533-a1ee473f3ee1
Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\SourceCode\PublishWeb\Content\webkit\6ebd0dd8-4216-42fa-a533-a1ee473f3ee1' is denied.
- Does the error occur for all input URLs or any particular URL?
- Is this occurring in all the machine or in server?
HtmlToPdfConverter converter = new HtmlToPdfConverter();
WebKitConverterSettings settings = new WebKitConverterSettings();
settings.TempPath = $"{Directory.GetCurrentDirectory()}{@"\wwwroot\temp"}";
settings.WebKitPath = Path.Combine(_honstingEnvironment.ContentRootPath, "QtBinariesDotNetCore");
converter.ConverterSettings = settings;
//string htmlText = "<html><body><img src=\"Bloom_Logo_Icon.png\" alt=\"Bloom_logo\" width=\"200\" height=\"70\"><p> <h1>Hello World</h1></p>"+strHtml + "</body></html>";
//string baseUrl = $"{Directory.GetCurrentDirectory()}{@"\wwwroot\images"}";
//PdfDocument document = converter.Convert(htmlText, baseUrl);
PdfDocument document = converter.Convert(http://bloom/emp/Empcourse);
MemoryStream ms = new MemoryStream();
document.Save(ms);
document.Close(true);
ms.Position = 0;
fileStreamResult = new FileStreamResult(ms, "application/pdf");
fileStreamResult.FileDownloadName = "Sample.pdf";
return fileStreamResult;
***I am using QtBinariesDotNetCore folder under my project directory.
all files copying to server while deploying.
any advice please?
- 7 Replies
- 6 Participants
-
ZJ Zsolt Jandzso
- Oct 16, 2017 12:10 PM UTC
- Jan 15, 2021 11:38 AM UTC