upload image outside of root directory
- Single Page
Posted 30 July 2012 - 15:53 PM
i.e..
set_field_upload('file_url','how/to/set/to/outside/directory');
thank you!
Posted 16 August 2012 - 15:15 PM
Posted 19 February 2014 - 05:32 AM
Technically this is not possible.Grocerycrud library wont allow you to save your files outside the application. But there is a way to achieve it - you need to alter the code to allow you to set a hardbound path where u can go and upload. But this may give trouble for the library to pickback the file from the given path and render it as output - so not recomended
This scenario is again not a practical solution on server side as if its a shared server - u might not have any option like this other then the folder / files alloted to u.
Again when u plan to display this - it will not be able to do it properly unless it is part of some web accessible folder.
There are other way you can do to achieve the same functionality without temporing the code...
1 - use callback_after_upload .. once the file is uploaded - copy / move the file from the upload path to your desired path... u will this way manage 2 save the file to your desired path. But everytime u want to display it - u have to programatically display it if the folder u uploaded is not a web accessible folder.
2 - Other way in linux system - u can achieve this even without the callback.. create a softlink of the folder u want to upload the files to into the assets/uploads folder and set the file upload path to that softlink and it should directly save the file to the desired path.
Happy GCing:)