How to retrieve upload link

rodeokid

Member
Hi, i have a upload element where our staff upload pdf every week, but i need to retrieve the link to this file cause i want to open them in a aridoc link... if i use the upload element name i get the way it is written in database, so [{file":"\/path/file.pdf","params":""}]... but i just want the adress like this /path/file.pdf

So is there a way to parse it to retrieve just the adress ? i am using a calc element to return the aridoc link.

Thanks

rodeokid
 
It's JSON encoded, so decode it into a structure ...

Code:
// assuming the data is in $whatever ...
$fileInfo = json_decode($whatever);
foreach ($fileInfo as $file) {
   // path is now in $file->path
}

... although the JSON you gave doesn't look right. Can you copy and paste an exact example.

Is this an AJAX upload, with multiple files enabled?

-- hugh
 
Ok thanks, i just did'nt read the tooltip saying that Ajax uploads would change the way it is save in database...so i just switch Ajax upload off and everything is fine. This is used by one person everyweek to post new weekly schedule for employees. So 1 file at a time, 1 person once a week... don't need Ajax on this. KISS method is fine for me.

My main goal was to use the pdfjs engine from Aridoc plugin because of the search option included for PDF file... was impotant for us to be able to search through weekly schedule, it can even highlight your name into the pdf file. I love Aridoc plugin, use it a lot on article, but was looking for a way to use it in Fabrik.

Thanks !

rodeokid
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top