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