Zend Framework Forum

Go Back   Zend Framework Forum > Zend Framework Forum > General Talks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-25-2009, 05:29 AM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-25-2009, 06:34 AM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-17-2009, 02:04 AM
Junior Member
 
Join Date: May 2009
Posts: 11
Default

Thank you. It worked.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 07:36 PM.


Designed by: Miner Skinz Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0