mgn Posted January 29, 2007 Share Posted January 29, 2007 My code, is to get data from a CSV file and place it in MYSQL DB.This works perfectly in local server.When iam trying to setup my webpage, which i tried to perform same task is to loadthat csv file's data into mysql table,but it won't work!! don't know why!!The error says "No such file or directory"[code]if ( $_REQUEST['readhid'] != ""){ $path = htmlentities($_POST['file']); $date = htmlentities($_POST['date']); $filename = basename($path); $fd = fopen ($filename, "r"); $contents = fread ($fd,filesize ($filename)); fclose ($fd); .......................... ............... ...........//and code is going on //Error "No such file or directory". //But it perfectly works when tested with localserver.} <form name = "frm" action = "readchk01.php" method ="post"> <table border="0" width="100%" id="table1"> <tr><td> Enter filename: <input type = "file" name = "file" /> </td></tr> <tr><td> Enter date: <input type = "text" name = "date" size = 20 value = ""/></td></tr> <input type = "submit" name = "sbt" value = "upload" onClick="return validate();" /> </td> </tr> <input type="hidden" name="readhid" value="read"> </table> </form>[/code] Link to comment https://forums.phpfreaks.com/topic/36170-help-needed-in-csv-file-loading/ Share on other sites More sharing options...
trq Posted January 29, 2007 Share Posted January 29, 2007 Some code usually helps! Link to comment https://forums.phpfreaks.com/topic/36170-help-needed-in-csv-file-loading/#findComment-171752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.