473,387 Members | 1,548 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,387 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 1307

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...
3
by: Rosie Chua | last post by:
Dear all, I am running an online file management server that allows web clients to upload files from a webform to the web server. Using the code "filename.PostedFile.SaveAs(fullPath);" I...
7
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the...
1
by: psb | last post by:
WHO HAS THE BEST COMPONENT FOR FILE UPLOAD? HELP!? has anyone achieved 100% success with HTTP uploading with Mac clients??? I thought the whole <input type="file" .../> was a w3c standard that...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
44
by: badvoc | last post by:
Hi to all, Firstly I must state my knowledge of php is limited but I am a quick learner. I have taken on the task of finishing a friends website due to his untimely passing and have hit a problem...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.