|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
pics not copying
i have a script which moves pictures from on directory to another, but it isn't copying them correctly. here is the code:
PHP Code:
here is the error message I'm getting: Warning: copy(/home/thecheat/passedtime.com/pics/pending/68/chico_megan1.jpg>): failed to open stream: No such file or directory in /home/.padrino/thecheat/passedtime.com/security/registration.pcgi on line 165 Warning: unlink(/home/thecheat/passedtime.com/pics/pending/68/chico_megan1.jpg>): No such file or directory in /home/.padrino/thecheat/passedtime.com/security/registration.pcgi on line 170 so it isn't copying right, and I was wondering, why are there little brackets on the end of it? ie: chico_megan1.jpg>): is that normal? the picture does exist and I can't figure it out! thanks
__________________
hey it's the CHARKING |
|
#2
|
|||
|
|||
|
I have a feeling you will need the permissions to be '0777' Try it and see what happens.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
Also, in the future, a quick way to check if file permissions are a problem when working with files on the filesystem, you can use:
PHP Code:
|
|
#4
|
|||
|
|||
|
well i jsut tried that changing the permissions, and that didn't work. I had changed them to 755 because I had thopught that my host had required that. I got the same error message (although the user, me, was able to add the pictures to the site from my computer... !! i can't udnerstand this. I will ask the host again, I have asked before and they said they didn't know what te problem was, that it was a programming error, and not something they could fix... um ok. thank you.
|
|
#5
|
|||
|
|||
|
So you are absolutely certain that you have permission to access the file you are copying from?
What about the directory you are copying to? What are the exact permissions on those files? Who is the owner of the files? Is your host running apache? |
|
#6
|
|||
|
|||
|
I own the files, I thought. I mean I put them there and it's my website... I've never had a host before so it's all pretty new to me. I decided that maybe the folders I had made weren't set with the right permissions, so I made a quick script and executed it to set the files to 755 (the host says this is what I have to do, because they use something else to make it work right, so don't use 777). And yes it is running apache. I'm going to also post a message to the hosts' forum.
|
|
#7
|
|||
|
|||
|
It does not matter what your account username is at your host.
If your account name is "thecheat", and you uploaded the files or created them under the shell, they will be owned by "thecheat" (Example: chown thecheat chico_megan1.jpg) Web servers do not run under the user account (or they should not)... it would be a security risk. The web server normally runs its process under a special, no privileged user called "nobody" or "web" or "www" or "apache", with the former being the most popular. (In IIS the equivalent user is IUSR_%COMPUTERNAME%) Try chowning some of the files to the "nobody" user and see if you can access them. I have a good feeling that is the issue (permissions). |
|
#8
|
|||
|
|||
|
yes also you cant set persmission on files that are on a windows platform, only works for linux...if you are running a windows platform, you will have to upload to the cgi-bin folder
|
|
#9
|
|||
|
|||
|
Quote:
Permissions can be set on directories regarding this user and that would determine whether your could a. write to (upload) a particular directory b. browse the directory ... As for uploading to the cgi-bin folder... I doubt that would be good for security. Would you really want to allow file uploads to your cgi-bin directory so a potential hacker could upload some virus, then activate the virus running the app from the web browser? |
|
#10
|
|||
|
|||
|
note to self *find out how laidback has all the answers* =]
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > pics not copying |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|