ajaxCRUD.com

» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAX

   by loud canvas media

AjaxCRUD Class Documentation / Reference Material

<< Reference overview
<< Home

setFileUpload

allows a field to accept file uploads
void setFileUpload ( String fieldName, String serverUploadFolder, String webUploadFolder, [Array permittedExts] )
This function allows a field (or multiple fields) in your table to allow file uploads. What this essentially means is that the field you set to handle file uploads inserts the file's relative path to the file.

Note: you must chmod the folder to which you're uploading files to 777 (world writable)

Details

Type function
Returns web-safe filename of uploaded file (on upload

Parameters

fieldName
The field name you want to accept file uploads
serverUploadFolder
The full OR relative path to the folder which will contain the uploaded file(s) on the server
webUploadFolder
The relative and web accessible path to the folder which contains the uploaded file(s)
permittedExts (optional)
An array with allowed file extensions supported by this upload

Example

Example 1:
$tblDemo->setFileUpload("fldFilename", "uploads/", "uploads/");

Example 2:
$allowedExts = array("png", "jpg", "jpeg", "gif", "bmp", "tif", "tiff"); $profile->setFileUpload("fldAvatar", "profiles/", "profiles/", $allowedExts);

See also

New, Edit

 

"Brilliant. Saved insane amounts of time. `nuff said."
~Soule

What is a business/commercial website?

A commercial website is one created for a business, for which purpose is generating revenue or cash flow of any type (and that isn't under a non-profit organization). So if you're selling a product, selling advertisement, selling a service, or just marketing a commercial business, your site is commercial. A company website is also commercial even if it doesn't sell anything, as it's purpose is to front a commercial company.
Close