1 Answer
Ok, I solved my issue with base64_encode function
.
First, I send the URL encrypted:
$encrypted = base64_encode($file->path);
return view('product', compact('product','encrypted'));
Then I get data into a variable on-page javascript.
var tboe = '{{$encrypted}}';
This variable becomes global and I get the variable from separated .js file like:
//example
var file = atob(tboe);
I believe this makes the user reach the file hard. I can't find another way.
0 comments:
Post a Comment
Thanks