Hello! I’m trying to upload a file from a form in a module I’m writing. Here’s the code I’m using for the form:
<
blockquote>$r .= $DSP->form(‘C=modules’.AMP.’M=vcardvi’.AMP.’P=update’, ‘target’);
$r .= 'Test Form:
’;
$r .= ‘<input type=”text” name=”Test” value=”’ . $query->row[”Agents”] . ‘”>
‘;
$r .= ‘<input type=”hidden” name=”MAX_FILE_SIZE” value=”10000000” />
Choose file to upload
<input name=”uploadedfile” type=”file” value=”’ . $query->row[”image”] . ‘” >
‘;
$r .= $DSP->qdiv('itemWrapper', BR.$DSP->input_submit($LANG->line('update_vcardvi')));
$r .= $DSP->form_c(); [/quote]
I have a field in there called “Test Form” that is basically used to make sure the data on the form is being sent. That field gets sent just fine, it’s the file that’s not uploading. And it’s not even moving it to the proper folder. The folder permissions are correct and everything. I think that this form that it generates is not a multipart/formdata style form- if this is correct- how do I do this?). Here is the file upload procedure:
$filename=”“; $target_path = “images/”; $target_path = $target_path . basename( $_FILES[‘uploadedfile’][‘name’]); if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target_path)) { $filename=basename( $_FILES[‘uploadedfile’][‘name’]); }
Can anyone help me?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.