Let me start off by saying that IE7 is entirely lame. Now to my problem...
It seems that IE7 has some issues with some drupal functions. I have a simple file upload form I use to upload a file to a particular location. The functionality works perfectly. Until, that is, we try it with IE7. The browse functionality works just fine. I can select the file I want and the path shows up in the browse field. Then I click the upload/submit button, and instead of uploading as it has been, the browse text box just clears itself and then nothing else happens. The path to the file I want just disappears from the box, and that's it.
Brilliant! Microsoft's ultra plot for stopping all uploads...
I don't know what's going on here. It's a site built on drupal 5.5, with lots of modules (custom and downloaded). I can understand CSS issues (not really, but I accept them), but this one just doesn't make any sense. This functionality seems to work in IE6. It's nothing fancy. Here's the form and submit function code:
///////////////////////////////////////////////////////////////////////
// images upload form
///////////////////////////////////////////////////////////////////////
function classified_images_upload_form($nid)
{
$form['imageupload'] = array(
'#type' => 'file',
'#title' => t('Upload New Image'),
'#size' => 45,
'#attributes' => array('id'=>'Image' ),
);
$form['nid'] = array(
'#type' => 'hidden',
'#value' => $nid,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Upload',
);
$form['#attributes'] = array(
'enctype' => 'multipart/form-data',
'id' => 'uploadform',
);
return $form;
}
///////////////////////////////////////////////////////////////////////
// image upload form handler
///////////////////////////////////////////////////////////////////////
function classified_images_upload_form_submit($form_id, $form_values)
{
// put form fields into variables
$nid = $form_values['nid'];
// create destination path
$path = 'files/classified_images/classified_nid_' . $nid . '/';
// move file to storage folder
$file = file_save_upload('imageupload', $path);
}
Now, before anyone asks, "why aren't you using IMCE?" The answer is that it really wasn't right for what I was doing. Regardless, that's not the issue. The issue is why is this working in everything but IE7. Is IE7 really that lame?
Thanks,
Caleb
Comments
Still having an issue with
Still having an issue with this one. Anyone have any ideas?
Thanks,
Caleb
http://www.cube-escape.com
Anyone...? Anyone? Anybody
Anyone...? Anyone?
Anybody have any ideas at all? Could it be javascript killing the form field?
help
Thanks,
Caleb
http://www.cube-escape.com
Update
We tested this same problem on another system with IE7, and it works just fine. So, now the question becomes "What is it about that IE7 install that would kill the upload?"
Is there some type of strange option that is checked or unchecked? A bug (never happen) in IE7 that would kill an upload field?
Thanks,
Caleb
http://www.cube-escape.com
is ur site online ?
hi, cant say much untill i see it happening .. maybe javascript, maybe some html missing ..
this is code snippet from upload module, I will suggest reading code of upload_form and _upload_form in upload.module ..
this doesn't have #attributes but i guess u have set it up right ..
--------------------------------------------------------
Dipen Chaudhary
www.dipenchaudhary.com
--------------------------------------------------------
Dipen Chaudhary
www.qed42.com ( Drupal development services specialize in social networks and other user generated content platforms )
www.dipenchaudhary.com
Weird, uploading a file is
Weird, uploading a file is not exactly a drupal function(as in PHP and server side stuff) as much as it is a client side thing(browser, html) so you might wanna check your return values and html to track down the problem.