 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Programming Facts Blog: Upload large(Big) files in PHP using .htaccess
by Chris Cornutt February 17, 2010 @ 13:19:06
Rakshit Patel has posted a tip to the Programming Facts blog that those out there wanting to upload larger files through your application - change your settings via one of three ways to tell PHP it's okay.
I have seen many developers who find difficulties when working with larger files upload in php. When files which are too large in size [...] If you are uploading file which is larger than 2MB size than here i am showing you the way to upload larger files using PHP.
The method's pretty much the same in each of the three methods. You can either have the settings in your httpd.conf (if you have access to it), in the php.ini or in a .htaccess file in the directory your PHP script is in.
voice your opinion now!
upload large file tutorial phpini httpdconf htaccess
Matthew Turland's Blog: Splitting PHP Class Files
by Chris Cornutt January 25, 2010 @ 13:23:56
Matthew Turland, in trying to solve a problem from work, needed a way to split out some code into two files to simplify and make it easier to use them individually.
The issue I ran into was due to all the generated PHP classes being housed in a single file. I had to process two WSDL files that had several identical user-defined types in common. As a result, I couldn't simply include the two PHP files generated from them because PHP doesn't allow you to define two classes with the same name.
He used the tokenizer extension to create a simple command-line script that did the splitting for him. This script could potentially be used for splitting out other kinds of files too - "unpacking" them from their combined state. You can download the latest version from Matthew's github account.
voice your opinion now!
tutorial split class file wsdl
Brian Moon's Blog: Using ini files for PHP application settings
by Chris Cornutt January 20, 2010 @ 10:40:39
In a new post to his blog Brian Moon looks at a handy piece of functionality that comes with the default PHP installations (and is used by several major frameworks like this one) - using INI files to store settings for an application.
One of the challenges of this [three tier server setup] is where and how to store the connection information for all these services. We have done several things in the past. The most common thing is to store this information in a PHP file. [...] We have taken [it] one step further using some PHP ini trickeration. We use ini files that are loaded at PHP's startup and therefore the information is kept in PHP's memory at all times.
They use the get_cfg_var function and the "--with-config-file-scan-dir" option to tell PHP to automatically load in the ini files it finds in the named directory. He gives an example of both a simple configuration and a more complex situation where a MySQL instance can read from the ini file containing the username/password/host information.
voice your opinion now!
ini file setting getcfgvar tutorial
Andrew Johnstone's Blog: Lock Files in PHP & Bash
by Chris Cornutt January 05, 2010 @ 12:40:39
Andrew Johnstone, inspired by a previous post on file locking to avoid cron job overlaps, as posted his own method and give a few more examples of how it can be done.
In order for a lock to work correctly it must handle, Atomicity / Race Conditions, and Signaling. I use the following bash script to create locks for crontabs and ensure single execution of scripts.
His bash script looks at the processes currently running and checks to be sure there's not already one there. If not, it takes the script given and executes an instance. If the process has finished running but the lock file is still there, it removes it and moves on to the execute. He includes a few examples of how to use it and the code for a PHP class that makes it easy to check if something's running, locked or what the current signal/status of the process is.
voice your opinion now!
lock file bash script tutorial
Abhinav Singh's Blog: How to use locks in PHP cron jobs to avoid cron overlaps
by Chris Cornutt December 29, 2009 @ 12:45:31
In this new post from Abhinav Singh on how to use file locking to keep your cron jobs from trying to use the same resources.
Cron jobs are hidden building blocks for most of the websites. They are generally used to process/aggregate data in the background. However as a website starts to grow and there is gigabytes of data to be processed by every cron job, chances are that our cron jobs might overlap and possibly corrupt our data. In this blog post, I will demonstrate how can we avoid such overlaps by using simple locking techniques. I will also discuss a few edge cases we need to consider while using locks to avoid overlap.
He includes some sample code - both the class to create the functionality and a script showing how to make use of it (and, of course, an example of it in use).
voice your opinion now!
cron file lock tutorial
Developer.com: Managing File Uploads with the Zend Framework
by Chris Cornutt November 06, 2009 @ 07:56:50
On Developer.com today there's a new tutorial that looks at working with file uploads in Zend Framework applications and looking more specifically at the Zend_File_Transfer component.
Chances are you've become well acquainted with the Web-based mechanism used to upload files to the Web. But how does this mechanism actually work? What process results in the file being transferred from your computer to the remote server? In this tutorial I'll show you how to create your own file upload mechanism using the popular Zend Framework, which makes accepting, validating, and processing uploaded files a walk in the park.
They look at creating a simple upload form and how to tie a Zend_File_Transfer instance to the backend of it to make uploading and validating the files a simple process. You can find out more information on the component here and another related component, Zend_ProgressBar, here.
voice your opinion now!
zendframework file upload zendfiletransfer
DotVoid.com: Problem with downloading files with Internet Explorer over HTTPS
by Chris Cornutt October 01, 2009 @ 09:48:28
On the DotVoid.com blog Danne shares a quick tip on forcing downloads over HTTPS to Internet Explorer (which, of course, has to be difficult about it).
The problem is that Internet Explorer does not handle file dowloads without caching over https very well. Or at all. According to knowledge articles on Microsofts website the problem occurs when having one or two of the http headers. [...] Previously I have have just omitted the http header "Pragma: nocache" for IE but it seems it does not always help.
So the fix is relatively simple - rely on the $_SERVER['HTTP_USER_AGENT'] value to tell if it's an IR browser or not. If it is, "Pragma: cache" works. If not, stick with "Pragma: no-cache".
voice your opinion now!
download file ie browser https tutorial
NETTUTS.com: Online File Storage with PHP
by Chris Cornutt July 16, 2009 @ 10:28:42
This new tutorial from NETTUTS.com takes a look at creating an online file storage system - uploading files and having them linked for download.
In this tutorial, I will show you how easy it is to create an online file storage system with PHP. You will learn how to upload files with PHP and list them by scanning the "uploads" folder.
You can download the source to get started right away or you can work through their tutorial - complete with code snippets and screenshots - to build out this simple system. They also throw in a little Javascript (jQuery) to show/hide files based on which of the file types you select.
voice your opinion now!
download tutorial storage file
|
Community Events
Don't see your event here? Let us know!
|