We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Developing a Module- Need Help With File Upload from a form

Development and Programming

pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

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?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.