SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_FILES[] not being uploaded

    Hello,

    I'm having some problems with a file upload...

    I'm getting this error:

    Notice: Undefined index: uploads in...(location)

    I've tested for the $_FILES array and it's not there. The form is below, and everything should be set up properly (I've set up file uploads many times). Also, I've checked phpinfo() and file uploads are on and I'm not getting anywhere near the maximum file size.

    HTML Code:
    <form enctype="multipart/form-data" method="post" action="index.php?p=add-category">
    <input type="hidden" name="MAX_FILE_SIZE" value="1048576" />
    <table id="cms">
    
    	<tr>
    		<td class="f_label" class="mandatory">Name:</td><td><input type="text" name="name" value="<?php if(isset($_POST['name'])) echo stripslashes($_POST['name']); ?>" /></td>
    	</tr>
    	
    	<tr>
    		<td class="f_label">Description:</td><td><textarea name="description" rows="5" cols="20"><?php if(isset($_POST['description'])) echo stripslashes($_POST['description']); ?></textarea></td>
    	</tr>
    	
    	<tr>
    		<td class="f_label">Image:</td><td><input type="file" name="uploads" /></td>
    	</tr>
    	
    	<tr>
    		<td><input type="hidden" name="submitted" value="TRUE" />
    		<input type="hidden" name="MAX_FILE_SIZE" value="1048576" />
    		</td><td><input type="submit" name="submit" value="Add Category" class="subbtn" /></td>
    	</tr>
    </table>
    </form>
    All other submitted information is coming through as it should.

    Any help would be greatly appreciated.

    Cheers,

    Jon

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found the problem. There was nothing wrong with the code, I was testing using Plesk's site preview and by the look of it, it doesn't accept the $_FILES array. I've tested it on another domain on the same server, and it's fine.

    Cheers,

    Jon


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •