Jump to content

PHP Upload


Daney11

Recommended Posts

Hey guys,

 

Im having a problem with upload modify.

 

Im using

 

<input type="hidden" name="MAX_FILE_SIZE" value="300000"><input name="file" type="file" />

 

if(empty($_POST['file'])) {
$file_name = 'NULL';
} else {
$_POST['file'] = FALSE;
$errors[] = 'Wrong File Type';
}

if(!in_array($ext,$allowed_filetypes, $_POST['file'])){
   $errors[] = 'Please Make Sure Your File Is Below 512kb In Size and is in .gif Format';
            }

if (empty($errors)) {

move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile);

 

The file upload works when i add news and im using the same values in everything on news_modify but i get the error wrong file type. and when i var_dump post file i get the file name..

 

Any ideas? this is strange.

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.