Re: move_uploaded_file lose variables
- From: Acrobatic <jbnunn@xxxxxxxxx>
- Date: Fri, 23 Nov 2007 08:46:32 -0800 (PST)
Is the directory the system is writing the file to set with the
correct permissions?
On Nov 23, 10:37 am, nicemot...@xxxxxxxxx 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...
.
- Follow-Ups:
- Re: move_uploaded_file lose variables
- From: nicemotion
- Re: move_uploaded_file lose variables
- References:
- move_uploaded_file lose variables
- From: nicemotion
- move_uploaded_file lose variables
- Prev by Date: move_uploaded_file lose variables
- Next by Date: Re: PHP and SQLIte: UPDATE statement fails
- Previous by thread: move_uploaded_file lose variables
- Next by thread: Re: move_uploaded_file lose variables
- Index(es):
Relevant Pages
|