 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Christian Weiske's Blog: A MIME type for .php files
by Chris Cornutt April 14, 2011 @ 09:17:06
Christian Weiske has a recent post to his site looking at something most PHP developers don't even think about when serving up their scripts - the MIME types for PHP files.
While setting some svn properties at work, we wondered about the correct MIME type for .php files.
He found several in the official IANA list including "text/php", "application/php" and "application/x-http-php" - all valid but none of them considered a standard. He talks about the ones supported by linux distributions (like Debian/Ubuntu) and some reasoning that might make "application/php" the best choice of the list. He points out some downsides to the choice, though, including the fact that something starting with "application/" should considered "machine readable" only despite PHP just being text.
voice your opinion now!
mime type application text iana linux machinereadable plaintext
Sameer Borate's Blog: Pushing xpi mime content from php
by Chris Cornutt May 20, 2009 @ 07:06:09
In this new post to his blog, Sameer shows how you can push content with the xpi content type out from your PHP scripts (for things like a Firefox toolbar/extension).
A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. Once installed on my blog I wanted Firefox to recognize it as an addon and install it rather than displaying a 'save/open' dialog.
Since his hosting provider (GoDaddy) didn't seem to work with adding it into an .htaccess file (an AddType for Apache), he had to force the download type with a few calls to header with the right content type, file size and file name to push it to the user.
voice your opinion now!
firefox extension apache addtype mime xpi
NETTUTS.com: How to Open Zip Files with PHP
by Chris Cornutt December 31, 2008 @ 12:04:06
The NETTUTS.com site has a new tutorial/screencast posted looking at their method for opening up uploaded zip files with PHP:
ThemeForest has a nice feature; It allows the authors to upload zip files containing screenshots of their themes. A script then extracts these files and displays the images accordingly. Though I doubt that the developers used PHP to accomplish this task...that's what we're going to use!
They create a simple form with one field - a file input - and write some basic PHP around it. The script ensures that it was a zip file that was uploaded (based on the mime type) and passes it through a ZipArchive class to do the hard work. This class and the rest of the source can be downloaded from the site.
voice your opinion now!
open zip file tutorial upload mime type download source
DevShed: Composing Messages in HTML for MIME Email with PHP
by Chris Cornutt July 30, 2008 @ 14:34:59
DevShed continues its look at sending MIME emails with PHP in the fourth part of the series - a method for sending HTML in the message.
In this article, I'm going to show you how to provide the MIME mailer class with the ability to send email messages in HTML format. This will greatly extend its functionality, so don't miss this tutorial.
They start by reviewing the class they've created so far, including an example of its use. From there they modify it slightly to make it easy to embed the HTML content into the email by adding the addHTML and buildHTMLPart methods.
voice your opinion now!
compose email tutorial mime html content
DevShed: A Better Way to Determine MIME Types for MIME Email with PHP
by Chris Cornutt July 24, 2008 @ 07:53:18
Continuing on in their look at sending MIME emails with PHP, DevShed has posted a better way for you to determine the correct MIME type of the file you're wanting to send (third part of the series).
I demonstrated how to build a modular MIME mailer class in PHP 4; it was provided with the capacity to send messages in plain text, and to work with different types of file attachments. This class implements a private method, called "getMimeTypes()," which, as its name would suggest, comes in handy for determining the correct MIME type of a given file. [...] However, the logic implemented by this method is rather primitive and can definitely be improved.
They start with a review of the previous code (PHP4) and show how to get the correct mime type of the file based on the extension mapped to an array of types.
voice your opinion now!
mime tutorial type mail php4 class getmimetypes extension
DevShed: Handling Attachments in MIME Email with PHP
by Chris Cornutt July 16, 2008 @ 12:58:17
DevShed has posted the second part of their series looking at handling MIME attachments in PHP generated emails today. This time they focus on the modification of their PHP4 class to make sending the emails easy.
In this second tutorial of the series, I'm going to teach you how to improve the initial structure of the MIME mailer class developed in the first article by giving it the ability to work directly with attachments. Sounds fairly interesting, right? Then don't waste any more time in preliminaries and begin reading this article now!
They refresh you on the code from the former tutorial and show you how to modify it to work with more than just the simple plain-text attachment like before (with binary information, things like JPEGs, PDFs and other text formats like XML and HTML).
voice your opinion now!
attachments mime email tutorial class
DevShed: Sending MIME Email with PHP
by Chris Cornutt July 10, 2008 @ 08:49:20
In this new tutorial on DevShed Alejandro Gervasio explains how to send emails from PHP with MIME payloads attached.
One of the most common tasks that a PHP programmer has to tackle is the development of applications that send MIME email in one form or another. In simple terms, MIME email consists of an extension of traditional email technology and comes in handy for sending email messages in fancy HTML and handling file attachments in a wide variety of formats.
In this first part of the series he just lays the groundwork - creating the mailer class they'll use for the series and using it to send a sample email (a basic message with a plain text MIME block).
voice your opinion now!
mime email tutorial payload class binary
DevShed: Retrieving Information on Selected Files with a PHP 5 File Uploader
by Chris Cornutt March 27, 2008 @ 09:31:04
DevShed has continued their series (here's part one) looking at the use of file uploading in your PHP scripts. They build on that foundation and add in some more useful features this time:
The initial script in the first tutorial of this series lacked some important features, such as the implementation of an effective error handling module and the ability to check the MIME type and size of the file being uploaded. In this second installment of the series, I'm going to improve the logic of the script from the first tutorial to provide it with the capacity to retrieve useful information concerning the entire file uploading process.
They look back at the previous tutorial to remind you of some of the concepts and then move on to show you how to get information about the file (like the MIME type, name and size of the uploaded file). The last page is just the full source code for the cut and pasters out there.
voice your opinion now!
tutorial php5 file upload information mime name size
|
Community Events
Don't see your event here? Let us know!
|