image

I have a browser button ,when i browse that one the path will be displayed, but not the picture what can i do to saw the picture.

<div class="float-left margin-bottom" style= "height:200px width:200px">
						<span class="stack" id="pic1">
						<img src="img/demo/gallery/picture-5.jpg">		
 				        </span>
					</div>	
					<div class=" field-block button-height">
							<span class="input file"><span class="file-text"></span>
							<span class="button compact">Browse..</span>
							<input name="file-input" id="file-input" value="" class="file withClearFunctions" type="file"></span>
						
					</div>

Open in new window


this is the coading.

can u pls help me
Srujani DuvvapuAsked:
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.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It is a little unclear as to what you are asking.

I think you are asking about uploading an image?  The browse button just grabs the path then you are supposed to have server side code to accept the file.  

Are you looking for something like ckfinder?  http://cksource.com/ckfinder
0
Srujani DuvvapuAuthor Commented:
I couldn't understand u r answer.
if i can browse some image from my files that could be viewed in  here.

                                            <span class="stack" id="pic1">
                                    <img src="img/demo/gallery/picture-5.jpg">            
                                 </span>

i miss the simple logic.
0
Rainer JeschorCommented:
Hi,
perhaps the following may help you:
<form name="testme" id="testme" method="post">
	<div class="float-left margin-bottom" style= "height:200px width:200px">
		<span class="stack" id="pic1">
			<img id="preview" src="img/demo/gallery/picture-5.jpg">
		</span>
	</div>	
	<div class=" field-block button-height">
		<span class="input file">
			<span class="file-text"></span>
			<span class="button compact">Browse..</span>
			<input name="file-input" id="file-input" value="" class="file withClearFunctions" type="file" accept="image/*" onchange="previewFile(event)">
		</span>
	</div>
</form>
<script type="text/javascript">
	var previewFile = function(event) {
		var fileReader = new FileReader();
		fileReader.onload = function(){
			var preview = document.getElementById('preview');
			preview.src = fileReader.result;
		};
		fileReader.readAsDataURL(event.target.files[0]);
	};
</script>

Open in new window


This works locally on my machine in IE11 and Chrome, but you should test it also on your web server also with other browsers.

HTH
Rainer
0

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
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.