473,396 Members | 1,987 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,396 software developers and data experts.

uploading a file onto an ftp site

I've been looking for a solution for this for a bit... I decided to
just try and copy and paste the solution from php.net to try and still
nothing.

//theUpload.php
<?php

echo"<form enctype=\"multipart/form-data\" action=\"result.php\"
method=\"post\">";
echo" <input type=\"hidden\" name=\"MAX_FILE_SIZE\"
value=\"30000000\" />";
echo" Send this file: <input name=\"userfile\" type=\"file\" />";
echo" <input type=\"submit\" value=\"Send File\" />";
echo"</form>";
?>

//result.php
<?php
$uploaddir = 'Products_images/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];

print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging
info:\n";
print_r($_FILES);
}
print "</pre>";
?>

this results in the following errors....

Warning: move_uploaded_file(Products_images/aPicture.bmp): failed to
open stream: Permission denied in /home/blah/public_html/result.php on
line 11

Warning: move_uploaded_file(): Unable to move '/tmp/phpDDU9vj' to
'Products_images/aPicture.bmp' in /home/blah/public_html/result.php on
line 11
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => aPicture.bmp
[type] => image/bmp
[tmp_name] => /tmp/phpDDU9vj
[error] => 0
[size] => 230454
)

)

I tried setting the permissions of the Product_images folder to write
for owner and world.. then i tried to do the same for public_html with
no avail.

Any suggestions??
-Jim
Jul 17 '05 #1
0 987

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

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
0
by: -Jim | last post by:
I've been looking for a solution for this for a bit... I decided to just try and copy and paste the solution from php.net to try and still nothing. //theUpload.php <?php echo"<form...
0
by: Raj | last post by:
Hello, I am planning to provide the Pause/Resume while uploading files. Our site is using both java applet and activex to do this. The list of selected files will be stored in an encrypted...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.