PHP Classes

File cannot be opened

Recommend this page to a friend!

      Quick CSV import  >  All threads  >  File cannot be opened  >  (Un) Subscribe thread alerts  
Subject:File cannot be opened
Summary:Getting error message: file cannot be opened: [empty]
Messages:3
Author:Michi Kind
Date:2006-08-18 14:15:45
Update:2007-09-26 10:12:48
 

  1. File cannot be opened   Reply   Report abuse  
Picture of Michi Kind Michi Kind - 2006-08-18 14:15:45
Everything seems to work, except I am always getting this message:
Errors: file cannot be opened: [empty]

The csv is not empty!
System: Excel2003-written .csv-file, mysql is hosted on a Linux-Server (standard-ports), PHP Version 4.3.10-16.
What am I doing wrong?

Thanks,
Michael

  2. Re: File cannot be opened   Reply   Report abuse  
Picture of gav gav - 2006-12-05 22:34:40 - In reply to message 1 from Michi Kind
Hi Michael,

I had the same problem, I contacted Alex who wrote the script he pointed me in the right direction. In PHP 4.2.0 and later the $HTTP_POST_FILES array has been changed to $_FILES so you need to change "$csv->file_name = $HTTP_POST_FILES['file_source']['tmp_name'];" to "$csv->file_name = $_FILES['file_source']['tmp_name'];" without the " in the Quick_CSV_import_example.php file.


Good Luck

Gavin Evans

  3. File cannot be opened   Reply   Report abuse  
Picture of bimeldip bimeldip - 2007-09-26 10:12:48 - In reply to message 2 from gav
hi,
I am having a problem...when i run this codes in my localhost..it works perfectly fine but when i upload the file to a server(my friends)
i am unable to run it and the encoding (drop down list) is empty and i cannot import the data into a temporary table in mysql database...
Can i know why this happens... the error that i get is :

PHP Notice: Undefined variable: HTTP_POST_FILES in /usr/home/www/staging/b/trial/Quick_CSV_import2.php on line 13, referer: http://pdswebspace.serveftp.net:88/staging/b/trial/