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 8765749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:22:00+00:00 2026-06-13T16:22:00+00:00

I want to read the picture from user’s local file. (the user is under

  • 0

I want to read the picture from user’s local file. (the user is under ie7 -ie9, so it doesn’t support fully version of html5) I find the first time I assume the input|file value, the picture doesn’t show, the second time I change another picture, the image can show. Just want to know how to make the first time I input picture it is can show.

I want read the picture from user’s local file, I apply below code:

function ShowImage(obj){ 
  var allowSuffix=".jpg|.gif|.bmp|.png"; //.jpg,.bmp,.gif,.png

  var suffix=obj.value.substring(obj.value.lastIndexOf(".")+1).toLowerCase();

  var browserVersion= window.navigator.userAgent.toUpperCase();

  if(allowSuffix.indexOf(suffix)>-1){
    if(browserVersion.indexOf("MSIE 7.0")>-1 || browserVersion.indexOf("MSIE 8.0")>-1 || browserVersion.indexOf("MSIE 9.0")>-1){//ie7, ie8, ie9 
      obj.select();
      var source=document.selection.createRange().text;
      obj.blur();

      var newPreview = document.getElementById("divNewPreview");
      newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = source; 
      newPreview.style.width = 160; 
      newPreview.style.height = 170; 
      newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").sizingMethod = 'scale';

      $("#divPreview").attr("style","display:none");
      $("#divNewPreview").attr("style","filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);width:160px;height:170px;border:solid 1px #d2e2e2;");

    }
  }
}

the html part code is easy like:

<div id="divNewPreview" style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image ); width: 160px; height: 170px; border: solid 1px #d2e2e2; display: none;"></div>
<p>
  input file: <input type="file" onchange="ShowImage(this)" />
</p>
  • 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-13T16:22:02+00:00Added an answer on June 13, 2026 at 4:22 pm

    Older browsers have no access to the local filesystem. You need to post it to the server before you can view the file.

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

Sidebar

Related Questions

Hi I can't understand this error I want read this XML file: <?xml version=1.0
I want to read a INI file from python, and I came up with
I want to read the pdf file from raw folder if devices have any
In my project I read a bitmap picture from assets directory and I want
I have a text file. I want read that file. But In that if
i want to read an html file by using jquery get function, replace some
I want to read a file piece by piece. The file is split up
I want to read .ppt files from the iPhone mail app. I have already
I want to read a xls file and then parse it. How can i
I want to copy a picture from asstets folder and paste it in my

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.