Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want simply a link, which on click open folder from your computer and ask to choose an image for your profile.
it seens as like in Facebook profile picture.
Please, if any body know something then plz upload
Posted
Updated 22-Feb-18 1:46am
v2
Comments
[no name] 12-Jan-13 8:09am    
In which language do you want answer c# or vb ?
Er.D.K.Malhotra 12-Jan-13 8:19am    
in C#...

Please check below, there is a source code and demo include. This is a Ajax based file upload
http://net.tutsplus.com/tutorials/javascript-ajax/uploading-files-with-ajax/[^]

Following is a Ajax file upload provided by Microsoft Ajax Control Toolkit
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx[^]

Please check this

http://www.uploadify.com/demos/[^]
 
Share this answer
 
v2
Comments
Er.D.K.Malhotra 12-Jan-13 7:56am    
This is not that ans which i want...
plz give desired solution (code will be better)
Tharaka MTR 12-Jan-13 8:22am    
if you are able to check the above site, you may found the working sample there.
http://www.uploadify.com/documentation/uploadify/implementing-uploadify/

and also, you can find the documentation here
http://www.uploadify.com/documentation/
Tharaka MTR 12-Jan-13 8:27am    
Please check the answer, I have added new URL which will help you
$("#profileImage").click(function(e) {
$("#imageUpload").click();
});

function fasterPreview( uploader ) {
if ( uploader.files && uploader.files[0] ){
$('#profileImage').attr('src',
window.URL.createObjectURL(uploader.files[0]) );
}
}

$("#imageUpload").change(function(){
fasterPreview( this );
});
#imageUpload
{
display: none;
}

#profileImage
{
cursor: pointer;
}

#profile-container {
width: 150px;
height: 150px;
overflow: hidden;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
}

#profile-container img {
width: 150px;
height: 150px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="profile-container">
<image id="profileImage" src="http://lorempixel.com/100/100" />
</div>
<input id="imageUpload" type="file"
name="profile_photo" placeholder="Photo" required="" capture>
 
Share this answer
 
Comments
CHill60 27-Nov-17 11:27am    
The question was asked and answered nearly 5 years ago.
Stick to answering new questions where the OP still needs help. Make sure you are not repeating something that is already in the thread. Learn to format the code in your posts, and don't just post code snippets without some explanation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900