Jump to content


Photo

PLS HELP. FOPEN function


  • Please log in to reply
6 replies to this topic

#1 php_coder_dvo

php_coder_dvo
  • Members
  • PipPip
  • Member
  • 18 posts
  • LocationPhilippines

Posted 29 August 2006 - 08:33 AM

can anyone help me, why i cannot open a file particularly CVS file.

here it goes, I create a scipt to open a csv file and import it to the database. Using the html input type="file" to brows a csv file. I tried it on the windows (winxp) the script works very fine, however when i upload it to my server which is linux. when i browse a csv file, i had an error

"Warning: fopen(PARTNER_REPORT_USA_.CSV): failed to open stream: No such file or directory in /opt/lampp/htdocs/freshfire.ca/cms_admin/import.php on line 8

Warning: fgetcsv(): supplied argument is not a valid stream resource in /opt/lampp/htdocs/freshfire.ca/cms_admin/import.php on line 10
"

and im stuck on this error. tnx guys for your help....



#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 29 August 2006 - 08:57 AM

Are you sure the file you entered in the fopen exists?

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 php_coder_dvo

php_coder_dvo
  • Members
  • PipPip
  • Member
  • 18 posts
  • LocationPhilippines

Posted 29 August 2006 - 09:08 AM

yes the file does exist, you see i created a script to browse file particularly csv, and when the user select a csv file on the windows platform, the script or the fopen function cannot read the file... my php script was on the linux server... cause i assume that the user wants to browse csv on the windows..

tnx for the reply, and help..

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 29 August 2006 - 09:10 AM

So the file is in the same place as the script
and it is in CAPS
"PARTNER_REPORT_USA_.CSV"
And it has the _ after usa?
Tell me the problem, I will try tell you the solution

#5 php_coder_dvo

php_coder_dvo
  • Members
  • PipPip
  • Member
  • 18 posts
  • LocationPhilippines

Posted 29 August 2006 - 09:25 AM

the file is not on the same place, the php script was ont the linux, and that script can browse a csv file, assuming that the file was on the windows

#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 August 2006 - 10:03 AM

You mean the php file is not on the server which looks for a file on a remote PC. If thats the case then you cannot do that. As PHP runs on the server, it cannot interact with the client (remote PC). What your php script is doing is trying to find the csv file on the server and thus you are getting the returned error.

#7 php_coder_dvo

php_coder_dvo
  • Members
  • PipPip
  • Member
  • 18 posts
  • LocationPhilippines

Posted 29 August 2006 - 10:19 AM

Ok, I understand, Thank You very Much Guys, GOD BLESS....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users