Hi,
I have a short basic script to upload files. It works fine with small files,
but with longer files it gets stuck.
Here's the fragment, the input file is loaded in "$file" from an HTML form
as usual.
....
$img_str = fread(fopen($fi le, "r"), filesize($file) );
$data = addslashes($img _str);
// --------------------- up to here the execution is correct and fast (<1
second)
$sql="INSERT INTO $table (".
" file_name,".
" file_type,".
" file_size,".
" bin_data)".
" VALUES (".
" '$file_name',".
" '$file_type',".
" '$file_size',".
" '$data')";
// --------------------- it gets stuck
here!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!
mysql_query($sq l) or die ("SQL error ..$sql");
I have already set the php.ini variables as follows:
memory_limit = 16M
upload_max_file size = 6M
I also checked the execution time to max_execution_t ime = 300 (even though I
don't believe it should be necessary).
The server is a P4 1.8 GHz, 256MB RAM
Any suggestion? Am I missing out something?
Thanks in advance,
G.
I have a short basic script to upload files. It works fine with small files,
but with longer files it gets stuck.
Here's the fragment, the input file is loaded in "$file" from an HTML form
as usual.
....
$img_str = fread(fopen($fi le, "r"), filesize($file) );
$data = addslashes($img _str);
// --------------------- up to here the execution is correct and fast (<1
second)
$sql="INSERT INTO $table (".
" file_name,".
" file_type,".
" file_size,".
" bin_data)".
" VALUES (".
" '$file_name',".
" '$file_type',".
" '$file_size',".
" '$data')";
// --------------------- it gets stuck
here!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!
mysql_query($sq l) or die ("SQL error ..$sql");
I have already set the php.ini variables as follows:
memory_limit = 16M
upload_max_file size = 6M
I also checked the execution time to max_execution_t ime = 300 (even though I
don't believe it should be necessary).
The server is a P4 1.8 GHz, 256MB RAM
Any suggestion? Am I missing out something?
Thanks in advance,
G.
Comment