473,770 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with move_uploaded_f ile()

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 with the move_uploaded_f ile()
but none seem to work.

Here is what it looks like:
move_uploaded_f ile($_FILES['fichier']['tmp_name'], "cv/" .
$_FILES['fichier']['name']);

But no file in the cv directory, at all. I tried with /cv/, D:\SiteWeb
\Immobiluxe\cv\ (hard path to the directory on the server), I tried
only $_FILES['fichier']['name'] in the hope it would go in the current
directory, still nothing.

I used the getcwd() function to know which directory I'm in and it
tells me "D:\SiteWeb\Imm obiluxe"

I also tried /SiteWeb/Immobiluxe/cv

I'm now out of things to try, also the file is in fact uploaded
because a

if (is_uploaded_fi le($_FILES['fichier']['tmp_name']))

returns true

Really I have no clue
Jul 28 '08 #1
1 1624
I solved the problem.

The site is on an IIS server and I didn't have the proper rights on
the folder to move data to it with php. I fixed this

On Jul 28, 3:33*pm, Sebzzz <seb...@gmail.c omwrote:
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 with the move_uploaded_f ile()
but none seem to work.

Here is what it looks like:

move_uploaded_f ile($_FILES['fichier']['tmp_name'], "cv/" .
$_FILES['fichier']['name']);

But no file in the cv directory, at all. I tried with /cv/, D:\SiteWeb
\Immobiluxe\cv\ (hard path to the directory on the server), I tried
only $_FILES['fichier']['name'] in the hope it would go in the current
directory, still nothing.

I used the getcwd() function to know which directory I'm in and it
tells me "D:\SiteWeb\Imm obiluxe"

I also tried /SiteWeb/Immobiluxe/cv

I'm now out of things to try, also the file is in fact uploaded
because a

if (is_uploaded_fi le($_FILES['fichier']['tmp_name']))

returns true

Really I have no clue
Jul 28 '08 #2

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

Similar topics

5
7652
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 file: ".$_FILES." -> $imagefile"); } else { enter record into database...
1
10683
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 minimum. simpleupload.php <form enctype="multipart/form-data" action="upload.php" method="post"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="200000"/>
6
3377
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 my IIS but refuses to work on the Apache. All I know is that the script stops working at move_uploaded_file() function. The warnings echo'ed are: Warning: move_uploaded_file(images/nieuws/TIDEEY%7E1.jpg): failed to open
3
476
by: jmlin84 | last post by:
I'm using the code: if(move_uploaded_file($_FILES, $target_path)) { echo "The file ". basename( $_FILES). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; }
2
16300
by: Brian | last post by:
Hi I am moving a site to a new server, I have been testing it and one of the pages uses move_uploaded_file, but I get a Permission denied. The directory I am moving it to is chomd of 755, if I change it to 777 it does upload but the owner is www-data, but I then can't download it using a FTP client (which I have to do) as it's the wrong owner, so I have to leave the chomd as 755, but
12
2904
by: mantrid | last post by:
Im trying to move a file but am having luck my code is below. The temp and target paths are valid as they echo correctly. but I cant get the copy() function to work, or the rename() function $target_path = $targetdir . basename($uploadedfile); $temp_path = $tempdir. basename($uploadedfile); echo "Target - ".$target_path." Temp - ".$temp_path."<br>";
5
3373
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 />"; } ------------------------ When I try to move the file using move_uploaded_file it fails. --------------
1
1420
by: Nosferatum | last post by:
I intend to upload documents (file_up), categorize them in 4 main categories (k_cat), have additional sub-categories (lec_cat) just for querying and getting sub-categorized output of the files when listed with date (dato_inn) and the submitters details "uploaded_by". But my script will not work. Anyone clever out there seeing what's wrong? This is my upload form, the script at the bottom:
3
1225
by: adamjblakey | last post by:
Hi, Can anyone see what is wrong with this function. The problem is that when it creates the 450px image it comes out black and not in colour like the thumbnail. Any ideas? <?php function uploadimage($value){ $file_type = $value; $file_name = $value;
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10004
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5313
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
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.