Click here to Skip to main content
11,709,536 members (53,831 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET
while uploading images the path given to store images is not found.
Posted 24-Dec-12 18:50pm
Krunal Rohit at 25-Dec-12 0:51am
Provide your code...
hiphopper0123 at 25-Dec-12 1:14am
if u expect help then provide your code
Oleksandr Kulchytskyi at 25-Dec-12 3:39am
Are envisioning to expose any code to community?)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You should provide your code and explain more about your problem.
ok, I can guess that you are talking about image path of ASP.NET Client side. you cant find full path of any uploaded document. So you can encode your uploaded image on client side and also can view the image, after postback on button click get the encode (base64) data to binary and save to database or store image on application server.

follow this given code:

<form id="form1" runat="server">
        <asp:Image ID="imgEmployee"  runat="server" ImageUrl="" Width="100px"
                    Height="120px" />
        <script type="text/javascript">
            function handleFileSelect(evt) {
                var fileUpload = document.getElementById('<%=photoUpload.ClientID%>');
                var imgEmployee = document.getElementById('<%=imgEmployee.ClientID%>');
                var files =; // FileList object
                // Loop through the FileList and render image files as thumbnails.
                for (var i = 0, f; f = files[i]; i++) {
                    // Only process image files.
                    if (!f.type.match('image.*')) {
                    var reader = new FileReader();
                    var base64Data;
                    reader.onload = (function (theFile) {
                        return function (e) {
                            // Render thumbnail.
                            var span = document.createElement('span');
                            base64Data =;
                            var fileSize = base64Data.length;
                            var IndexData = base64Data.indexOf('base64,');
                            var fileName = escape(;
                            imgEmployee.src = base64Data;

                    // Read in the image file as a data URL.


<asp:FileUpload runat="server" ID="photoUpload" TabIndex="7"  onchange="handleFileSelect(event)"   />


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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 524
1 OriginalGriff 250
2 Peter Leow 229
3 Maciej Los 185
4 Mika Wendelius 160
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,037
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 25 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100