anchor for file in WRITEPATH |
Hi , i move my uploaded file in WRITEPATH.'/uploads/' . How can i set anchor to downolad file ?
I try : Code: <?=WRITEPATH.'uploads/'.$row->nome_originale ?>
Look in the CodeIgniter User Guide Global Funtions.
PHP Code: $newName = $file->getRandomName(); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
from a form
Code: $file = $this->request->getFile('userfile'); So now we have the name of the file with its extension. you could save that info into a database, even with a slug name if required;to retrieve later and since you know where you put it you have: name of file location of file for a download link for a specfic pdf in routes i have : Code: $routes->get('linkPdf/(:segment)','ProducePDF::getPdf/$1'); that should give you something to think around so linkPdf/Adinkra-symbols-of-Ghana goes to ProducePDF::getPdf where ProducePdf is a class and getPdf is one of its methods that does all the work.
(09-17-2022, 12:58 AM)captain-sensible Wrote: from a form And to force download of a file ?
a simple html download link is :
Code: <a href="/path/image.jpg" download> text </a> Then think of how to express the code in the code box in a view. try it in basic html5 ; when the text is clicked on the file downloads. |
Welcome Guest, Not a member yet? Register Sign In |