Problems with move_uploaded_file()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sebzzz

    Problems with move_uploaded_file()

    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
  • Sebzzz

    #2
    Re: Problems with move_uploaded_f ile()

    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

    Comment

    Working...