locked
Bitmap works on local drive but not on network drive RRS feed

  • Question

  • User-1725127896 posted

    I am creating a new bitmap as follows

    BitImage1 = New Bitmap(StrPicDirectoryHold)

    The StrPicDirectoryHold has the full path and .jpg name for example p:\test\test.jpg

     

    When I run this and select a picture from my local 'c' drive the code works fine.  When I select a picture from the 'P' drive which is a network drive I get an "parameter is not valid" error message.  Is there something different that I would need to do to access the Network drive?  I already checked and all the permissions are correct and I can get to this drive fine from my computer.

    Here is the actual error

     

    Parameter is not valid.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Parameter is not valid.

    Source Error:

    Line 524:                If BlnAbort = False Then
    Line 525:
    Line 526:                    BitImage1 = New Bitmap(StrPicDirectoryHold)
    Line 527:                    PProdThumbPicSizeW.Value = BitImage1.Width
    Line 528:

    Sunday, November 9, 2008 7:30 PM

All replies

  • User1096912014 posted

    I vaguely remember I've seen something similiar on another forum. I've ran a search, but was only able to find this advice on a similar case

    Check if ASPUSER has access to the network drive your ASP.NET application is trying to access.

    Sunday, November 9, 2008 7:47 PM
  • User815917640 posted

    Give ASPNET user permission to the folder. 

    Sunday, November 9, 2008 8:24 PM