⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Upload files without adding to a database table



manushimn
  • profile picture
  • Member

Posted 16 May 2014 - 18:30 PM

Is there a way to upload multiple files to a directory without connecting with database. I dant want a database table for this purpose. Only the directory should be updated when a new file is added and when we click delete the file in the directory should be deleted. Is there a way to do this? and is there a way to integrate jquery file uploader with grocery crud

Amit Shah
  • profile picture
  • Member

Posted 19 May 2014 - 08:47 AM

Well it is quite possible what you say...

What you can do is use .. $crud->add_fields ... to set all the fields u want in the add form. There u can add extra field that u want the user to treat as an upload. Set that field type to be file_upload with all the necessary parameters.. This will suffice yr need of u uploading the file .. and when u click on delete (only in add form) it will also delete the file.

 

add callback_before_insert to the crud and there in that function unset the extra field that was set for upload..

thats it.. its all done.. the game should roll your way...

 

Happy GCing :)