Jump to content

File field has no temp name?


djanim8

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.