#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Location
    Birmingham, UK
    Posts
    722
    Rep Power
    43

    ASP : LoadPicture : Permission Denied


    Hi,

    when I was testing a site on my intranet, all was working but however when I use the LoadPicture code on the internet site I get this error:
    Code:
    Microsoft VBScript runtime  error '800a0046'
    
    Permission denied: 'loadpicture'
    
    /cms/functions/image-dimension.asp, line 7
    The file it is referring to is:
    Code:
    <%
    dim iWidth, iHeight
    sub ImgDimension(img) 
      dim myImg, fs 
      Set fs= CreateObject("Scripting.FileSystemObject") 
      if not fs.fileExists(img) then exit sub 
      set myImg = loadpicture("C:\AltRoot\portal\cms\upload\amspar.jpg") 
      iWidth = round(myImg.width / 26.4583) 
      iHeight = round(myImg.height / 26.4583)  
      set myImg = nothing 
      Set fs=nothing
    end sub 
    %>
    It looks like a permission thing (judging by the error!) any clues on how to resolve this problem?

    Many thanks in advance,

    Janusz
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    18
    Rep Power
    0
    hi ...
    as i see in ur code i think u should change the code of line 7 to this :

    set myImg = loadpicture("amspar.jpg")

    depends where u upload the pic in the file manager of ur website .. i wish if my solution is correct try it and tell me if it is or not ?

    quince
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Location
    Birmingham, UK
    Posts
    722
    Rep Power
    43

    ....


    Hi,

    that was just one example... as I said it does work on the intranet server but not on the internet server. I tried all sorts of paths but no luck... the line in the code referring to the image should read:
    Code:
    set myImg = loadpicture(img)
    I then call the function dynamically.

    Suppose my question is more targeted at whether this particular function can be disabled in IIS?
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    You probably need to grant permissions to the web server user account to the picture file.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2004
    Location
    Birmingham, UK
    Posts
    722
    Rep Power
    43
    you mean to image.jpeg?

    if so I've done all I an regarding this but still no luck

    pleas help, alternatively is there anyway in ASP to figure out what the dimensions of a particular images is and also it's filesize

    Thanks,

    Janusz
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    1
    Rep Power
    0

    Unhappy


    I have exactly the same problem,

    I have to server, one with Windows Server 2003 and another with Windows XP Professional.

    I have tried many things, the permissions of my directories and my images files are exactly the same on both servers and the LoadPicture works only on the server with Windows Server 2003. The IIS configuration looks to be the same on both servers too.

    I don't see why the error is "Permission denied", my servers have the same permissions on the images I want to open.

    The only difference I see is IIS 6 vs IIS 5, may be IIS 5 doesn't support it ? I don't know but i will continue to search cause it only work on my internet server, but I can't see the final result on my test server before publishing because it's the one with WinXP!

    If I find anything I'll tell you
    Jonathan
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    1
    Rep Power
    0

    ASP : LoadPicture : Permission Denied


    I had the opposite problem. It ran fine on my site, but not locally. I granted WRITE permissions to my "Users" group and it's running fine now.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    1
    Rep Power
    0
    The user IUSR_username must have write permission, for the loadpicture function to work.

    Ensure this..

    anspuli
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    LoadPicture : Permission Denied


    Hey Fellas

    I was using the same code and setting the same error on line number 7. I tried all possible permissions on "img" folder as suggested in all forums.. but abortive..

    Finally i found that its a silly mistake... I found that there is no picture inside "img" folder so it cant load anything..i put some pictures inside "img" and it was sorted.

    regards
    devesh sagar

IMN logo majestic logo threadwatch logo seochat tools logo