Jump to content

PLS HELP. FOPEN function


php_coder_dvo

Recommended Posts

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

"[color=red]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[/color]"

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

Link to comment
Share on other sites

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..
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.