Reply to Re: move_uploaded_file lose variables

Your name:

Reply:


Posted by nicemotion on 11/23/07 16:57

On 23 Nov, 17:46, Acrobatic <jbn...@gmail.com> wrote:
> Is the directory the system is writing the file to set with the
> correct permissions?
>
> On Nov 23, 10:37 am, nicemot...@gmail.com wrote:
>
> > 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 and correct and i guess
> > it loses the $file_temp var (actually the printout of $file_temp0
> > return nothing)
>
> > i even tryed to write it repeating the parameters i/o using variables
> > but no results.
>
> > Anyone can help ?
>
> > Many thanks in advance
>
> > Nik
>
> > -----------------------------------
>
> > if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1"))
> > {
>
> > //// set variables
> > $file_temp0=($_FILES['Logo']['tmp_name']);
> > $file_temp1=($_FILES['Foto']['tmp_name']);
>
> > //folder of the image on the server
> > $percorso="foto/";
>
> > $nuovo_nome0=$percorso.$_POST['Logo'];
> > $nuovo_nome1=$percorso.$_POST['Foto'];
>
> > $insertSQL = sprintf("INSERT INTO marcalinea (ID_MarcaLinea, Marca_,
> > LineaProdotto_, Logo, Foto, Descrizione, Pdf_) VALUES (%s, %s, %s, %s,
> > %s, %s, %s)",
> > GetSQLValueString($_POST['ID_MarcaLinea'],
> > "int"),
> > GetSQLValueString($_POST['Marca_'], "int"),
> > GetSQLValueString($_POST['LineaProdotto_'],
> > "int"),
> > GetSQLValueString($nuovo_nome0, "text"),
> > GetSQLValueString($nuovo_nome1, "text"),
> > GetSQLValueString($_POST['Descrizione'],
> > "text"),
> > GetSQLValueString($_POST['Pdf_'], "int"));
>
> > //print ($file_temp0); // return nothings
> > //print ($nuovo_nome0); // returns correctly /foto/img_name
>
> > mysql_select_db($database_Conn_Bianchi, $Conn_Bianchi);
> > $Result1 = mysql_query($insertSQL, $Conn_Bianchi) or
> > die(mysql_error());
>
> > ////Everything ok 'till here; the following does't works:
>
> > ######### upload image########
>
> > move_uploaded_file($file_temp0, $nuovo_nome0);
> > move_uploaded_file($_FILES["Foto"]["tmp_name"],"foto/" .
> > $_FILES["Foto"]["name"]);
>
> > ###############################
>
> > $insertGoTo = "view.php";
> > etc...

hi acrobatic! - many thanks for your ppt reply

yes, it is; all permission are ok and the script to upload the files
separately works correctly.

The problem rises when i insert the record and upload the image on the
same page...i'm afraid the var are lost somewhere

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация