473,473 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Another File Upload Problem

I got a php script that makes a upload to my server. But it actualy don't works. I'm working on Kurumin Linux 2.13, Apache 1.3.26 and PHP4.
The source (it handles an string gotten in a form):

if ($file == "none") { echo"Try put an valid file.";
echo"<a href=index.html>back</a>";
}else {
copy($file, "myfile/".$file_name);
unlink($file);
echo"All Right!";
}

The erro:
Warning: Unable to create 'arquivos/exemple.txt': Permission denied in /var/www/up/upload.php on line 25

Ok, its a problem with permision, right?
But, how can I resolve this? How can I give permision to PHP write in my HD? Is it secure?
Thanks!
Jul 17 '05 #1
2 1823
Ok, its a problem with permision, right?
But, how can I resolve this? How can I give permision to PHP write in my HD? Is it secure?


CHMOD ist the Linux Command to change Permissions. Php has also a chmod
function.

Try this:

-> chmod("/somedir/somefile", 0755); // octal; correct value of mode
http://de3.php.net/manual/en/function.chmod.php

Greets,
Stefan Mehnert

Jul 17 '05 #2
"silveira neto" <ot**********@yahoo.com.br> wrote in message
news:0b******************************@localhost.ta lkaboutprogramming.com...
I got a php script that makes a upload to my server. But it actualy don't works. I'm working on Kurumin Linux 2.13, Apache 1.3.26 and PHP4. The source (it handles an string gotten in a form):

if ($file == "none") { echo"Try put an valid file.";
echo"<a href=index.html>back</a>";
}else {
copy($file, "myfile/".$file_name);
unlink($file);
echo"All Right!";
}

The erro:
Warning: Unable to create 'arquivos/exemple.txt': Permission denied in /var/www/up/upload.php on line 25
Ok, its a problem with permision, right?
But, how can I resolve this? How can I give permision to PHP write in my HD? Is it secure? Thanks!


I'm suprised it even gets that far. You are relying on register_globals =
On, you should use $_FILES instead...
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
7
by: clintonG | last post by:
I'm puzzled and don't think this is possible but if an application that is running on websiteA generates a file can FTP be used from websiteA to transfer that file to websiteB which would be...
3
by: mikecom | last post by:
Hi Maybe there is an oracle out there who can help. I have an aspx site and a simple fileupload control on it. Everything works fine except: I can reproduce an 404 error when trying to upload...
0
by: wwwmike | last post by:
Hi there, I am using the standard fileupload server tool in asp.net 2.0 to upload files to my server. Everything works perfectly until I figured out that certain files (under 4MB) gave me an...
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"...
1
by: SBK | last post by:
Hi All, Got a quick problem, hoping someone can help me out here. Using an Upload Control. If a file to upload is specified and another form action is committed (i.e. btnBack) then the upload...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.