SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upload image to Windows Server

    I am trying (without any success so far) to write a script that has a form for uploading an image to the server. In this case, it is a Windows server.

    In the past I have been able to get around the virtual server problem on a NIX server by using mkdir() to create a new directory with chmod 0777, copying the image to the new directory and them chmod the new directory back to 0755.

    However, this is not working on the Windows server. I cannot create a new directory, nor can I copy the image to an existing directory. In both cases I get a "Permission denied" error.

    Can anybody help?

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Is this your own server or hosting somewhere?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is a webhost's server.

    (On my own Windows machine I can get the script to run by manually setting the file permissions on the folder. However, I was hoping there is a solution to the file permission problem that can be accomplished inside the PHP script).

  4. #4
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I'm a little confused. I have no knowledge of the networking side of Win32 but I don't need to change any permissions on my WinXP Pro machine here to do any file system work.

  5. #5
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using FAT32 or NTFS?
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DJ P,

    I, too, am no Windows expert. However, to make a folder writable to PHP on my machine, I have to right click on the folder, select Security, and give "Everyone" Full Control.

    ... In the meantime, I've decided to store the images in the database. In the past, I've never been sure how to retrieve images from the database for display in a page, so I've always stored uploaded images on the server. However, I have it figured out now, so I'm going to store the images in the database. In this case, the images are small and there is not going to be too many, so I think this should work fine.

    Anyway, thanks for the responses.

  7. #7
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With FAT32, everyone has permission to access/modify files

    With NTFS, there are permissions similar to *nix chmod permissions.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  8. #8
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well I use FAT32 so I guess that's where I can do anything/everything


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •