djanim8 Posted August 1, 2007 Share Posted August 1, 2007 I had another post on here about this, but this is different and I think this is the problem. I have a file field to upload a csv file.. on one page it works fine, on another page it returns NOTHING for the temp name... here is the code for the form: <form id="frmAddMusic" name="frmAddMusic" method="post" action="uploadmusic.php"> Upload CSV File of Music: <input name="fleMusicCSV" type="file" id="fleMusicCSV" size="40" /><br /> <input name="Submit" type="submit" id="Submit" value="Upload Music" /> </form> and the code for the upload stuff: set_time_limit(600); echo $_FILES['fleMusicCSV']['tmp_name']."<br>"; $handler = fopen($_FILES['fleMusicCSV']['tmp_name'],'r'); while ($row = fgetcsv($handler,1024,"|","\"")) { the echo for the tmp_name returns nothing.. anyone have any idea whats going on? Link to comment https://forums.phpfreaks.com/topic/62912-file-field-has-no-temp-name/ Share on other sites More sharing options...
a1phanumeric Posted August 1, 2007 Share Posted August 1, 2007 Hi, Change your form to include this parameter: enctype="multipart/form-data" (so it looks like '<form id="frmAddMusic" enctype="multipart/form-data" name="frmAddMusic" method="post" action="uploadmusic.php">'), and add a hidden field like the following: <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Change the 100000 to whatever you want, 100000 = 100kb Ed. Link to comment https://forums.phpfreaks.com/topic/62912-file-field-has-no-temp-name/#findComment-313208 Share on other sites More sharing options...
djanim8 Posted August 1, 2007 Author Share Posted August 1, 2007 geez I totally forgot about that LOL thanks! Link to comment https://forums.phpfreaks.com/topic/62912-file-field-has-no-temp-name/#findComment-313213 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.