473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to check the Mime-type of an uploaded file

can any one plz help me to use mime type in php....there should be included mime_content_type( ) function...i want to upload a picture like .jpg,.jpeg,.gif extension....when i will upload the picture with that extension that will check the extension and it will show me the msg "The pic is upload successfully"...other wise (In case of other extension) it will show me "Image is invalid type".....so plz help me by giving proper and full code...
Regards.
Apr 24 '07 #1
3 1694
As you could see, no one cared about doing the work for you...
I'll just give you a hint as what to do when your mime_content_type function doesn't return nothing but an empty string:
-add the following to your php.ini

Expand|Select|Wrap|Line Numbers
  1. [mime_magic]
  2. mime_magic.debug = On
  3. mime_magic.magicfile = "path/to/your/magic.mime"
  4.  
Aug 20 '07 #2
Atli
5,058 Expert 4TB
As etiainen says, we will not write your code for you, as our Posting Guidelines clearly state. We are, however, happy to help you solve problems or answer questions you may face while writing the code yourself.

The mime_content_type() function has been deprecated. It is recommended that you use the FileInfo class (or functions) instead.
Aug 20 '07 #3
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem (did you know that threads whose titles that do not follow the Posting Guidelines actually get FEWER responses?).
Aug 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Erik Rosenbach | last post by:
I have a question about how to parse out mime from a message. I have email messages that are stored in a database table and these messages have mime headers embedded within them. How can I parse...
1
by: Imran | last post by:
Hi, Please bear with me as I have only 1 weeks .NET experience. I am using VB.NET to write a stand-alone client application that connects to a Web service. I successfully send a request for a...
3
by: John Mark Howell | last post by:
I've got a MIME message that was originally an HTML email with embedded images. When the email is received (to GMail) it is now in MIME format. The HTML portion is now split out into the HTML and...
0
by: Guoqi Zheng | last post by:
Dear sir, I am using my own tcpclient code to send email instead of using CDO. Question, I would like the mail message to be in mime multipart format. I am not familiar with mime. Does any...
2
by: asnowfall | last post by:
I am trying to build System.Mail.MailMessage object out of mime encoded SMTP data. I have following questions Byte byteMailData; //mime encoded STMP data for "email with attachment" 1)...
1
by: Maxwell2006 | last post by:
Hi, I need to read/extract the contents of MIME format files. Is there any feature in System.Net.Mime that can help me? The files that I am trying to work with are the saved web pages by IE6...
1
by: fabrizio.viggiani | last post by:
I need to send a mail message to an SMTP server. The .net framework provides System.Net.Mail namespace to send an email: - Build a System.Net.Mail.MailMessage and send it using SmtpClient The...
0
by: P | last post by:
Hello, I have some trouble with my application. It is written with PEAR, SMARTY .... I should send an email to me and with Bcc to 50's else adresses. But it send it just to me. I am on an...
0
by: andreas.baus | last post by:
Hello. I'm trying to build a client using .NET/C# that is capable of communicating with an existing Webservice written in Java using Apache Axis. Now, I've encountered a problem trying to...
3
by: b. dougherty | last post by:
Greetings all- I am trying to extract subject headers from emails that have been saved as text files. The subject headers are in MIME UTF-8 format, and so they appear like this: subject:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.