Jump to content

File Upload


leequalls

Recommended Posts

I have a form here http://party934.com/artist_contact.php that is supposed to upload 2 files. When the submit button is clicked the files do not upload however the data in the form is being sent.

 

This is how Im calling the files on submit:

$file_temp = $_FILES['mp3']['tmp_name'];
$mp3name = $_FILES['mp3']['name'];
$file_size = $_FILES['mp3']['size'];
$file_err = $_FILES['mp3']['error'];

$ifile_temp = $_FILES['image']['tmp_name'];
$imagename = $_FILES['image']['name'];
$ifile_size = $_FILES['image']['size'];
$ifile_err = $_FILES['image']['error'];

Link to comment
Share on other sites

This is actually a problem with your encapsulation type in the form itself. You need to set the form to be a multipart encapsulation:

 

<form enctype="multipart/form-data" action="yada.php" method="post">

 

The multipart is needed because you are dealing with binary data.

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.