+ Reply to Thread
Results 1 to 3 of 3

Thread: File upload PHP

  1. #1
    umair862 is offline Junior Member
    Join Date
    May 2009
    Posts
    11

    Default File upload PHP

    Hi,
    Following code works fine when i need to upload a file. Can anybody tell me what should $_FILES["file"]["type"] be if i want to upload a .php or a .htm file.
    Searched on internet but could not find.

    [PHP]if ((($_FILES["file"]["type"] == "application/pdf")
    || ($_FILES["file"]["type"] == "application/msword")||($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "application/vnd.ms-excel")
    || ($_FILES["file"]["type"] == "text/plain")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    && ($_FILES["file"]["size"] < $filesize))
    {
    Upload File
    }[/PHP]

    Thank you for Help
    Umair

  2. #2
    Tekerson is offline Senior Member
    Join Date
    Jul 2008
    Posts
    288

    Default

    It will be whatever the browser tell you it is, I'd create a simple script to upload to and dump the $_FILES array. I would think they would be text/php and text/html respectively.
    Brenton Alker
    PHP Developer - Brisbane, Australia

    blog.tekerson.com | twitter.com/tekerson | brenton.mp

  3. #3
    umair862 is offline Junior Member
    Join Date
    May 2009
    Posts
    11

    Default

    Thank you. It worked.

+ Reply to Thread

Similar Threads

  1. Upload/Edit File
    By Sami_ghname in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 06-15-2010, 11:00 AM
  2. Upload File
    By Sami_ghname in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 03-22-2010, 08:59 AM
  3. problem with upload file
    By derrida in forum General Q&A on Zend Framework
    Replies: 3
    Last Post: 11-18-2009, 03:53 PM
  4. File upload to database
    By Cindy in forum General Q&A on Zend Framework
    Replies: 5
    Last Post: 05-13-2009, 01:11 PM
  5. File Upload, Illigal
    By Themodem in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 10-06-2008, 11:08 AM

Posting Permissions

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