473,412 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

File upload problem

I developed a simple file manager a while ago in it worked perfectly until we switched hosting.

Now I can't upload files to any folder created through the file manager. If I create a folder in FTP, I can then upload anything to it using the file manager.

I suppose the problem is that when I create a directory from php it has different user & group than when I create it using FTP, since both folders get the right permissions (777).

Any ideas on how to solve this problem? safe_mode is enabled... could that be the problem?

Thanks
Fede
Apr 24 '07 #1
7 2099
devsusen
136 100+
Hi,

php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

susen
Apr 24 '07 #2
Hi,

php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

susen
I don't understand. If apache creates a directory, why can't it also upload files to it? I tried changing owner with chown and chgrp but it didn't work, and the directory already has chmod 777 :(

Thanks for your help!
Apr 24 '07 #3
devsusen
136 100+
Hi,

I hope u r getting some error. If not try to get the error then it will easier to understand the problem. Still it seems to me some permission problem happening.

susen
Apr 27 '07 #4
code green
1,726 Expert 1GB
The XAMMP package contains php, Apache and an FTP application Filezilla. They all seem compatible and I have Filezilla running to download files from a remote to a local server. I can't remember how I configured it, but Filezilla and Apache are compatible
Apr 27 '07 #5
I finally got error_reporting working (damn display_errors was set to Off by default) and this is what I get:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10022 is not allowed to access /var/www/vhosts/x.com/httpdocs/admin/archivos/test owned by uid 48 in /var/www/vhosts/x.com/httpdocs/admin/sections/files_publish.php on line 26

I'll try disabling safe_mode, but I think it's not something I can set.

Thanks
Fede
Apr 28 '07 #6
It worked by disabling safe_mode :D
May 1 '07 #7
devsusen
136 100+
thats gr8. :)

It worked by disabling safe_mode :D
May 2 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
4
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use...
6
by: Vic Spainhower | last post by:
Hello, I am trying to do a FTP file upload which works fine on my localhost but on my ISP server it fails. I can't seem to find where I can go to find the specific cause of the failure. In both...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.