Jump to content

Form Uploader


sanfly

Recommended Posts

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:

[code]<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>[/code]
Link to comment
https://forums.phpfreaks.com/topic/12012-form-uploader/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.