Location: PHPKode > projects > Agile Toolkit > atk4-atk4-addons-5a69383/misc/lib/Doc/Example/Upload.php
class Doc_Example_Upload extends Doc_Example {
	function init(){

		$this->add('H2')->set('File Uploading');
		$this->add('P')->set('File management in PHP is often messy, involves temporary directories or is even stuck in
				MySQL. Agile Toolkit implements a powerful yet very simple "Filestore". This is a class which helps to keep
				your files organized. From the moment your file upload have finished and it have been saved to a upload
				directory - Filestore creates a new record for this file using MVC concept. 

		$this->add('P')->set('What is really important is the flexibility and simplicity of this approach. You can now add
				upload field to your form and when form data is saved - you will receive filestore_file_id in upload field.
				The record in the database will automatically contain the file meta-information such as size and original

		$this->add('P')->set('In this example we are going beyond that. We are slightly modifying File model/controller by
				defining new field "sample_file" and saying that it must always be true in our case. By using that, you can
				only see or upload files which conform to this condition, therefore you will not be able to see any other
				files in the filestore.




$p->add('H4')->set('Previously Uploaded Files');




Return current item: Agile Toolkit