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

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.