php_coder_dvo Posted August 29, 2006 Share Posted August 29, 2006 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 8Warning: 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.... Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/ Share on other sites More sharing options...
Orio Posted August 29, 2006 Share Posted August 29, 2006 Are you sure the file you entered in the fopen exists?Orio. Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82067 Share on other sites More sharing options...
php_coder_dvo Posted August 29, 2006 Author Share Posted August 29, 2006 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.. Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82076 Share on other sites More sharing options...
onlyican Posted August 29, 2006 Share Posted August 29, 2006 So the file is in the same place as the scriptand it is in CAPS"PARTNER_REPORT_USA_.CSV"And it has the _ after usa? Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82077 Share on other sites More sharing options...
php_coder_dvo Posted August 29, 2006 Author Share Posted August 29, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82080 Share on other sites More sharing options...
wildteen88 Posted August 29, 2006 Share Posted August 29, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82091 Share on other sites More sharing options...
php_coder_dvo Posted August 29, 2006 Author Share Posted August 29, 2006 Ok, I understand, Thank You very Much Guys, GOD BLESS.... Quote Link to comment https://forums.phpfreaks.com/topic/18986-pls-help-fopen-function/#findComment-82093 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.