How to open any resource like pdf, image, text file etc., in a IFrame

Hi Experts,

I want to open a file which is located on hard disk in a IFrame. The URL is as follows
"C:\PALogic\pdf\hip new york\yourPlan.GIF", one of the folder contains spaces, here for example "hip new york" contains two spaces. My code is as follows
<iframe src="C:\PALogic\pdf\hip new york\yourPlan.GIF" id="pdfFrame" target="_self"/>

If i dont have a space in SRC URL its perfectly working fine, but when it contains space iam not able to display any thing.

Please suggest some thing.

Thanks in Advance,
Ravi Kiran Reddy KatkuriAnalyst ProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try using the "file" protocol:
<iframe src="file:///C:\PALogic\pdf\hip new york\yourPlan.GIF" id="pdfFrame" target="_self"/>
Ravi Kiran Reddy KatkuriAnalyst ProgrammerAuthor Commented:
Will this work in linux environment also....because my resource url is in linux machine??

a url typically starts with a protocol followed by "://" EX:
http:// OR ftp:// or file:///

(No, it's not a typo. The file protocol has three slashes not two).
So yes it should work, but only if accessed from the local machine and if you provide the correct path. In Linux you would not write "c:\... " because there is no such partition on the filesystem.

If you need to put this for people to retrieve from the internet, then no. You would need to set up a webserver and place the file within the webserver space. Additionally, the "file:///" protocol would not apply if served from within a web server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.