473,767 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check the Mime-type of an uploaded file

4 New Member
can any one plz help me to use mime type in php....there should be included mime_content_ty pe( ) function...i want to upload a picture like .jpg,.jpeg,.gif extension....wh en 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 1718
etiainen
40 New Member
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_ty pe 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 Recognized Expert Expert
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_ty pe() function has been deprecated. It is recommended that you use the FileInfo class (or functions) instead.
Aug 20 '07 #3
pbmods
5,821 Recognized Expert Expert
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
7715
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 out this mime content and retrieve only the text messages? Thank you, Erik
1
6120
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 list of items (i.e. getItemList), and successfully receive the list. I then send a request for individual items from the list (i.e. getItem), and successfully receive the item.
3
2739
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 the images (each in a MIME part). The MIME part for the image looks like some sort of abreviated compressed code. Does anyone know how to extract the original HTML back out of a MIME message?
0
1098
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 one know about a good tutorial about how to create a mime message in .NET? Or is there a dll, class can do this? How can I create a mime message?
2
3100
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) MailMessage.Body = Convert(byteMailData); If I do the above, will MailMessage object extract the Message BODY, Message HEADER and Attachments automatically.
1
15240
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 (save as web archive *.mht) Any help would be appreciated,
1
2890
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 message that I have to send is already in the form of a MIME stream (multipart, attachments and digitally signed), so using the classes of the System.Net.Mail namespace I have to: - parse the MIME - Extract the components - Build a MailMessage...
0
2947
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 easyPhP server. Here is my code $mail_queue =& new Mail_Queue($db_options, $mail_options);
0
1659
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 retrieve binary data (i.e. downloading files) which is sent by the service using the "SOAP with attachments" format (as per http://www.w3.org/TR/SOAP-attachments), i.e. as a MIME multipart/related message. Apparently, the.NET Webservice library does...
3
11021
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: =?utf-8?B?QVVUTyBQRU9QTEUgLS0gTWFuaGVpbeKAmXMgSmVmZiBCdW5jaCBpbiBIaWdoYmVhbXM7IExlZ2VuZGFyeSBSZWQgTWNDb21iczsgV2hv4oCZcyBTaGlmdGluZyBHZWFycz87IE1vcmU=?= What class can I use to decode the subject text?
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10009
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.