Click here to get back home

Problems with move_uploaded_file()

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Problems with move_uploaded_file() Sebzzz 07-28-2008
Get Chitika Premium
Posted by Sebzzz on July 28, 2008, 3:33 pm
Please log in for more thread options
Hi,

I have a form where user can attach a resum=E9 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_file()
but none seem to work.

Here is what it looks like:


move_uploaded_file($_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\Immobiluxe"

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_file($_FILES['fichier']['tmp_name']))

returns true

Really I have no clue

Posted by Sebzzz on July 28, 2008, 5:42 pm
Please log in for more thread options
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

> Hi,
>
> I have a form where user can attach a resum=E9 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_file()
> but none seem to work.
>
> Here is what it looks like:
>
> move_uploaded_file($_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\Immobiluxe"
>
> 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_file($_FILES['fichier']['tmp_name']))
>
> returns true
>
> Really I have no clue


Similar ThreadsPosted
Help - PHP problems July 30, 2004, 2:56 pm
PHP 4.3.10 Problems? January 3, 2005, 7:02 am
Problems with PHP 4.3.10 and 5.0.3 in IIS January 5, 2005, 4:19 am
problems July 11, 2005, 8:51 am
GD2 Problems? This may help... March 11, 2007, 10:52 am
GD problems: October 5, 2007, 1:49 am
mssql_connect problems July 21, 2004, 4:44 pm
Problems with chdir() July 23, 2004, 1:12 pm
Login problems July 25, 2004, 2:04 am
Problems with set_error_handler() :/ August 1, 2004, 3:43 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap