Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7722927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:19:00+00:00 2026-06-01T04:19:00+00:00

First let me say i dont know if this is possible the way im

  • 0

First let me say i dont know if this is possible the way im doing it so, i come here to the pros for help.

As the subject points out, What im trying to achieve is, that on button press, the content i want loaded appears in an iframe….

At first, what i did is this:
The iframe html is this:

<iframe id="my-frame" src=""></iframe>

and the simple form code is this:

<form action="#" method="post" target="my-frame">
<input type="file" name="localFile"  id="localFile">
 <input type="submit" id="Sbtn" name="Sbtn" value="submit">
</form>

Which should load what i selected inside the iframe i targeted called “my-frame” but instead, when i press
the button, it loads the currently opened page and i end up with like, one of those funhouse mirror effects that you see the same thing over and over and over inside itself…….or loads nothing at all, the iframe section stays white….

So i gave up and tried a bit of Js and again, not sure if this is the way to go about it but…well i gotta try something. So that said, i took out the “target=”my-frame” from the form part of it, and put in this.

var myFrame = document.getElementById("my-frame");
var btn2 = document.getElementById("Sbtn");
var field2 = document.getElementById("localFile");

btn2.onclick = function(){
        if(field2.value ==""){
            //enter error message or something.
        } else {
          myFrame.src = field2.value;
          return false;

        }
}

Then when i do this, i get errors like “page cannot be found” etc…not matter what i do the page cant be found.

the exact error i get is this:

Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.

to which i dont understand since im navigating to the file(whatever it is) via the wizard that comes up.

Now for further troubleshooting, when i do a regular link …for example(pseudo code)

<a href =" path to local file here " target="the iframe id"></a>

then it loads it in just fine…

so im lost.

Any ideas as to what im doing wrong or…something im missing?

Any tips,links, any help of any kind ill gladly and humbly accept.
thanks in advanced.

Somdow
http://somdowprod.net/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:19:01+00:00Added an answer on June 1, 2026 at 4:19 am

    As I understand, what you want is:

    • Pick a file with an input type=file
    • Click submit
    • The selected file should appear inside an iframe (what you expect)

    AFAIK, this can be done only with IE. Cause of the security settings for Chrome & FF are different (higher). You can try an alert command to see what really happen whith IE, Chrome & Firefox. Just change your code a bit like this :

    ...
    } else {
      alert(field2.value); ///--- add this line
      myFrame.src = field2.value;
      return false;
    }
    ...
    

    Open your file with all 3 major browsers (IE, Chrome, FF) & see result for each one when you choose file and click the submit button repectively.


    As I tested, the result for IE was the full path on hard disk to the file :

    C:\Documents and Settings\DUNGPRO\My Documents\A WALLPAPER\abc.jpg
    

    While Chrome replace the path with a fakepath:

    C:\fakepath\abc.jpg
    

    And firefox just give you the filename only:

    abc.jpg
    

    Yes, the fake path or filename only are what make it displayed 404-File not found. Only IE gives you the expected path & that’s why your code works properly with IE.

    Hope you don’t feel this is too bad, while almost these settings from Chrome & FF are default and impossible to change whithin your code. Just think they’re for user’s security & find another approach. Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me say I have read this useful article thoroughly and am using
First let me say that I did see this article: How to remove AspxAutoDetectCookieSupport
I can't figure this one out. At first let me say that my cache
Let say I have something like this: id | title | 1 | First
Let's say I have a first structure like this: typedef struct { int ivalue;
this is my first time posting here, but I didn't know where else to
First let me say I cannot do gem install, I don't know why. Probably
Let's say I have this collection: val a = Array(Array(1,2,3,4,5),Array(4,5),Array(5),Array(1,2,6,7,8)) Is there a way
First off let me just say, i dont want anyone to post solutions because
I don't know what's the best practice for this. Let's say I have some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.