I've developed a small application in php and mysql, where i'm uploading pdf and moving file to UPLOADS folder and storing path in database.
But in viewing after passing path i'm not able to open pdf on browser.
I've uploaded PDF.JS files in my folder aswel.
Below are my testing urls.
http://www.farukhzama.com/fileupload/index.php
http://www.farukhzama.com/fileupload/view.php
Your link is :
http://www.farukhzama.com/fileupload/viewer.html?file=uploads/47920-ombudsman-acknowledgement.pdf at view.php file, which is wrong path to get the pdf file.
Give it right path like this => http://www.farukhzama.com/fileupload/uploads/47920-ombudsman-acknowledgement.pdf
Thanks!
Related
a simple question that's freaking me out. I created an upload zone in which files are uploaded to a folder that was dynamically created by an mkdir. But if I wanted to download that folder how do I proceed? I don't necessarily need it to be made .zip just for me to be readable and that the files inside it are intact.
I tried pointing directly at the folder with the following href but it does not work.
<td align="center"><b>Scarica Bolle</b></b></td>
This is not the first time I am doing file upload using CI. However in this particular case I want to upload images or files to shortcut folder created at project root. This is what my project root looks like in following image:
So basically what I had been trying to do is using php filesystem function is_dir('goku') (goku is shortcut folder as shown in above image that links to C:\Users\Name\Desktop) and if true then create a sub-folder inside it and insert the image or file in that sub-folder. However I didn't find any way to make the shortcut folder recognize as directory and returns file upload error -The upload path does not appear to be valid. Upload works fine on other folder. I know that php is not recognizing the shortcut folder as directory because on running is_dir('goku') returns false. I have gone through all probable solutions but now again back to where I started. Any helpful hints regarding this is highly appreciated. Thank You!!!
Using the library Codeigniter
library upload single file and multi file
Easily upload .
Well, I got an API which read binary file from database and store it as "PDF" in windows temp folder, then it sends the path to that file to "PHP" page. What I want is to display that file over the browser.
The API returns the PDF file path: C:\Users\username\APPDATA\Local\Temp\some file.pdf. What I have done is setting that path to an iframe in my page,
but it shows nothing.
What am I missing here?
You should convert that local path to an url one.
Http://www.yourpage.com/folder_where_you_keep_those_files/file.pdf
And give the proper folder and file permissions.
The PDF is on YOUR computer, the user cannot access YOUR C:\ drive.
You cannot exchange your client-side files with someone server-side.
Store your PDF file on the server somewhere and set that path in the iframe.
You need to move that file from you local path (it can be your tmp folder or another folder that is not in your web accessible path) to your web directory so that you can put that in your iframe source.
Eg:
<iframe src="http://yourwebsite.com/somepdf.pdf" width="1000px" height="800px" >
I use mpdf for a php project but I am having difficulties generating pdf file with images. it displays the pdf file correctly on browsers but after I save the pdf file it doesnt display the images. I tried it with different browsers/OS and the result is little bit strange to me. it works on very browser and displays local pdf file correctly on linux machine. mac and windows it displays images on every browser but when I save the pdf file it doesnt display the images on local pdf. do you have any idea how to solve this problem.
Thanks
you have to use absolute linking, starting all the way at the top with the domain name.
I am trying to download some files. I have written a php script that can gather all of the address of the pdf files I need to download into a array but the file names on that server are odd. How does one go about downloading pdf files with php?
you can try (if I understand your question correctly)
file_put_contents('/your/file/name.pdf',
file_get_contents('http://www.example.com/oddFile.pdf'))
Check out the file or file_get_contents functions. It can take URLs as well as local filenames.
http://www.php.net/manual/en/function.file.php
http://www.php.net/manual/en/function.file-get-contents.php