Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/05/2007, 15:23
neonardo
 
Fecha de Ingreso: abril-2007
Mensajes: 21
Antigüedad: 17 años
Puntos: 0
ayuda con subida de archivos

tengo el siguiente script:

form:

Código:
 <form method="post" action="upload.php" enctype="multipart/form-data">
Description:<br>
<input type="text" name="form_description" size="40">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
upload.php:

Código:
 <?php
mysql_connect("localhost","username","password");
mysql_select_db("database_name");
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO uploads (description, data,filename,filesize,filetype) ". "VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>File ID: <b>$id</b><br>";
print "<p>File Name: <b>$form_data_name</b><br>";
print "<p>File Size: <b>$form_data_size</b><br>";
print "<p>File Type: <b>$form_data_type</b><p>";
y no me funciona, me aparece este error
Warning: fread(): supplied argument is not a valid stream resource in C:\wamp\www\subida\upload.php


help please!!!!!!!!!!!!!!!!