Hi!

Does anyone know how to upload a file, say in a form, with input type="file". But what I want is to display the uploaded file in an iframe in the same page.

Best Regards

Recommended Answers

All 3 Replies

In order to upload a file I believe you will need some backend code.

To display it in an iframe just link the file that is uploaded to your iframe src="" attribute.

Thank you for your answer!

How do I link the uploaded file to the iframe source?

I would like to select a file from a directory and upload it to an iframe. And if I could send the file at the same time to the server, it would be even better.

Use php to link the file to an iframe. If you have some source code so we can see what you are trying I can provide better help.

<iframe src="sourceoffile.png"></iframe>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.