3 Replies - 504 Views - Last Post: 11 October 2018 - 05:11 AM Rate Topic: -----

#1 aspfun   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 16-January 13

How to set up permission for the folder for web application?

Posted 30 August 2018 - 12:42 PM

I used code below to save PDF file into a folder. It works fine when running in local PC (Did not use local IIS but file system).

Once published app to the web server, PDF file can't be saved and saying that "Access denied".

How to set up permission for the folder for web application?

Dim sFileName As String = "\\server_order\Order\20180820order.pdf"

Dim rpt As New ReportDocument

rpt.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, sFileName) 

Is This A Good Question/Topic? 0
  • +

Replies To: How to set up permission for the folder for web application?

#2 andrewsw   User is offline

  • quantum multiprover
  • member icon

Reputation: 6775
  • View blog
  • Posts: 27,938
  • Joined: 12-December 12

Re: How to set up permission for the folder for web application?

Posted 31 August 2018 - 12:30 AM

Please quote the exact error message; a search of the exact message is likely to be fruitful.

What did you discover with a search of, for example, "asp.net file save access denied"?

found
Was This Post Helpful? 0
  • +
  • -

#3 aspfun   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 16-January 13

Re: How to set up permission for the folder for web application?

Posted 31 August 2018 - 04:14 AM

Here is error message which caught by try-catch-end try block

In AFax.aspx btnSendFax

System.UnauthorizedAccessException: Access to the path '\\Webserver\order\08302018141138662.pdf' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.WriteStreamToFile(Stream stream, String filename)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportStreamToFile(Stream stream, DiskFileDestinationOptions options)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.Reportdocument.ExportToDisk(ExportFormatType formatType, String fileName)
at AFax.PDFSaveToFolder()
at AFax.btnSendFax_Click(Object sender, EventArgs e)
Was This Post Helpful? 0
  • +
  • -

#4 Ankusha5674   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-October 18

Re: How to set up permission for the folder for web application?

Posted 11 October 2018 - 05:11 AM

All ASP.NET Web programs run under the context of the WPW3.exe that services the Application Pool that is hosting the Web program. WPW3.exe will present the credentials to be used as set by the Application Pool Identity. The WPW3.exe presents App Pool Identity/the credentials on the behalf of the Web program, which must be on the resource the program is trying to access..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1