Home > Archive > PHP Language > July 2006 > File Upload only works once
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
File Upload only works once
|
|
| Christina 2006-07-22, 6:56 pm |
| I have a file upload page and it works great - the first time I upload a
file. The app works beautifully on a Win2003 testing server - as many times
as I want to upload something. But on the production Linux server, when I
try to upload a second file, I get a standard "no file exists" type of
error. In the past, this error has been a result of permissions.
The site is an intranet, so all logins/passwords are handled at the
corporate/server level, not the site - each subfolder is then given group
permissions for access. Could the problem be an issue of having to set
permissions on the newly uploaded file as soon as it's uploaded? Would I
need to have a separate upload app in each subfolder in order for the person
to upload to it?
Any guidelines or ideas?
Thanks,
Chris
| |
|
| "Christina" <designer@centurytel.net> wrote in message
news:UpOdnYB1-7wi7V_ZnZ2dnUVZ_uqdnZ2d@centurytel.net...
> Could the problem be an issue of having to set permissions on the newly uploaded file as
> soon as it's uploaded? Would I need to have a separate upload app in each subfolder in
> order for the person to upload to it?
> Any guidelines or ideas?
> Thanks,
> Chris
I would say yes. If it works flawlessly on Windows and goes "pfft" on Linux then it is
probably permissions.
One way around having to deal with upload permissions is to use the FTP functions. You
inevitably still have to modify their ownership and permissions to execute or write them
though...
You would not need a *separate* application in each folder, just one in your "main" folder
that checked if each folder was writable before putting a file there, et cetera.
One last aside, depending on the files, file size, and access frequency, uploading to a
database can be a very fast approach at file management.
Hope that helps a bit...
-Lost
| |
| Christina 2006-07-28, 6:57 pm |
| Hi,
Thank you so much for your input. I've included my further
questions/comments:
"-Lost" <spam_ninjaREMOVEME@REMOVEMEcomcast.net> wrote in message
news:sbidnVo39pK-C1_ZnZ2dnUVZ_s6dnZ2d@comcast.com...
> "Christina" <designer@centurytel.net> wrote in message
> news:UpOdnYB1-7wi7V_ZnZ2dnUVZ_uqdnZ2d@centurytel.net...
>
> One way around having to deal with upload permissions is to use the FTP
> functions. You inevitably still have to modify their ownership and
> permissions to execute or write them though...
>
> You would not need a *separate* application in each folder, just one in
> your "main" folder that checked if each folder was writable before putting
> a file there, et cetera.
>
Can you give me an example of what the FTP functions are and how they are
used?
How would this be coded? The PHP manual often gets confusing and doesn't
give very detailed real-world examples or show what the results of code
would be.
> One last aside, depending on the files, file size, and access frequency,
> uploading to a database can be a very fast approach at file management.
There are several groups and each folder on the site has different group
permissions. That's why we decided against uploading the files to the
database itself, thinking that we would have to set group access permissions
on each document (650+)in the db. Being new to MySQL/PHP I don't know what
is possible in many cases.
Since we made the decision to do links instead of docs in the db, I never
researched how to load the actual document (not just a link to it) into a db
table. I'm sure it's a standard procedure and I would just need to read a
MySQL manual. Can you set different group access permissions to each table
in the db (then we could load each folder's docs into separate tables)? If
so, how can this be done?
>
> Hope that helps a bit...
>
> -Lost
>
|
|
|
|
|