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

move_uploaded_file() doesn't; returns an error.

11
my html file is
[HTML]

<html>
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>

<form action="addimgck.php" method="post"><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>

</body>
</html>

[/HTML]

Expand|Select|Wrap|Line Numbers
  1. php
  2.  
  3. <?php
  4. if (isset($_POST['uploadFile'])){
  5. $file = $_POST['uploadFile'];
  6. if ( move_uploaded_file ($file,"http://www.codex-ks.eu/up/po.jpg")  )
  7.       {
  8.         echo "The file has been successfully uploaded";
  9.        } else
  10.        {
  11.        echo "ERROR";
  12.        }      } else
  13.        {
  14.        echo "NO";
  15.        }
  16. ?>
  17.  
  18.  
  19.  
i am reciving ERROR
i have tryed someny ways but it did not worked .
"up" is the folder on my server where i want to upload image ,po.jpg is the name thet i want to call my uploaded image i don't know where is the problem maybe you can help me..
Oct 21 '07 #1
3 1827
pbmods
5,821 Expert 4TB
Heya, kujtim.

Check out this article to find out what is going on.
Oct 21 '07 #2
kujtim
11
i think you didn't understand me the problem is thet my function is returning false or beter say my upload is failing i don't know why is thet ,do you have any idea ???
Oct 21 '07 #3
Markus
6,050 Expert 4TB
Files aren't sent through
Expand|Select|Wrap|Line Numbers
  1. $_POST
they are sent through

Expand|Select|Wrap|Line Numbers
  1. $_FILES
  2.  
E.g -

Expand|Select|Wrap|Line Numbers
  1. $_FILES['uploadFile']['name']
  2.  
Hope that helped.
Here's a useful tutorial from the guys at w3schools.
Oct 21 '07 #4

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

Similar topics

5
by: neo002244 | last post by:
The move_uploaded_file() function is very quirky. I want to allow users to upload images to the Web site. Here is the code: if(!move_uploaded_file($_FILES, $imagefile)) { die("Could not move...
1
by: Felix Natter | last post by:
hi, I would like to upload a file (via a form), then read that (temporary) file and write the contents into a database. The first problem is that open_basedir=/home/CUSTOMER so I can't just read...
1
by: sa | last post by:
Trying to upload a file using win xp/iis/php. I've given full access to all accounts trying to get this to work? Yet I'm still getting read errors. Simplified the script below to the bare...
6
by: Stijn Goris | last post by:
HI all, I have created a script that allows a user to upload a picture. I have an IIS server runing on my own pc but the actual site runs an Apache server. The upload script worked perfectly on...
5
by: bill | last post by:
I can validate that the file uploaded because is_uploaded_file() returns true. --------- if (is_uploaded_file($_FILES)) { echo "File ". $_FILES ." uploaded successfully.<br />"; }...
7
by: nicemotion | last post by:
Hi all, the following easy script correctly insert a record in the DB but is not moving the images (Logo and Foto) to the server /foto folder. can't understand why 'cause the script is easy...
2
by: R.A.M. | last post by:
Hello, Please help in the following problem: I have written a PHP5 script uploading file: if ($_SERVER == 'POST' && isset($_POST) && isset($_POST) && isset($_POST)) { if...
3
by: groupie | last post by:
Hi, The code below is working - it returns the 'Received' message, however I cannot find the uploaded file in the destination folder, or anywhere else (other than source directory). I'm running...
1
by: Sebzzz | last post by:
Hi, I have a form where user can attach a resumé and I want my script to put it in the cv folder of the server and then send me the link by e- mail. However, I tried a lot of combinations...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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?
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
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,...

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.