Jump to content


Photo

Form Uploader


  • Please log in to reply
1 reply to this topic

#1 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 14 June 2006 - 07:43 PM

Hi

I have a form which i am using as part of a PHP CMS system. This form is used to upload files for a few different things. It works fine for images and text files, but when i try an mp3 or wmv file, It doesnt pass the temp file: ie: $_FILES['new_file']['tmp_name']; is empty. Is there something different about uploading media files?

Here is my form:

<form method="post" action="discography.php?action=editfile2" onsubmit="submitonce(this" enctype="multipart/form-data">
        <table cellspacing="10">
            <tr>
                <td align="right" valign="top"><b>File To Edit: </b></td>
                    <td valign="top"><?=$edit_file?></td>
            </tr>
            <tr>
                <td align="right" valign="top"><b>Current File: </b></td>
                    <td valign="top">
                        <?=$current_file?>
                    </td>
            </tr>
            <tr>
                <td align="right" valign="top"><b>New File: </b></td>
                    <td valign="top">
                        <input type="file" name="new_file" size="40"><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>(Max File Size: <?=$max_file_size?>)</b>
                    </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <br>
                    <input type="hidden" name="file_type" value="<?=$type?>">
                    <input type="hidden" name="file_id" value="<?=$id?>">
                    <input type="button" onclick="history.back();" value="&laquo; CANCEL"> 
                    <input type="submit" value="UPLOAD FILE &raquo;">
                </td>
            </tr>
        </table>
    </form>

If you're not part of the solution, you're part of the precipitate

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 15 June 2006 - 07:22 AM

Is $_FILES['new_file']['error'] returning anything other than 0?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users