| | |
problem with uploading several images with the same name.
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 32
Reputation:
Solved Threads: 1
I have a form where there is image, at the first time it displays the defualt image,when
the user uploads image, the new image appears. But when the user get out from this page and get in again and upload another image the same old image is still there. Its that when i upload image i give it id of employee. The same old image is there even if i render it in another page,although in the folder where the images are uploaded are changed with new image.
i would like to note that i am using windows vista, the desitination of upload is "E:\myporject\...", but the url of image is "../images/employees/123.jpg",
the image is being saved to the folder of development but the url of image is from the virtual path, even when i restart the computer and the visual studio, and the whole website its still there with the same old image.
plz help, how can i upload many images and give them the same name and only the last one is displayed in my application.
Thanks in advance.
the user uploads image, the new image appears. But when the user get out from this page and get in again and upload another image the same old image is still there. Its that when i upload image i give it id of employee. The same old image is there even if i render it in another page,although in the folder where the images are uploaded are changed with new image.
i would like to note that i am using windows vista, the desitination of upload is "E:\myporject\...", but the url of image is "../images/employees/123.jpg",
the image is being saved to the folder of development but the url of image is from the virtual path, even when i restart the computer and the visual studio, and the whole website its still there with the same old image.
plz help, how can i upload many images and give them the same name and only the last one is displayed in my application.
Thanks in advance.
You need to force the browser to refresh it looks like. Im afraid the easiest method is to change its name. maybe you could add a time to the end of the file i.e. "filename_20080607.jpg" etc.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
•
•
Join Date: Nov 2007
Posts: 32
Reputation:
Solved Threads: 1
I would like to mention that may it is not clear, but what I wanted to say that both I save to virtual path and read from virtual path. Here is the code that read image:
Here is the code that upload image:
Thanks for the try to name it with different name, using time but when i want to render the image, how can I know its name without saving it??!!
ASP.NET Syntax (Toggle Plain Text)
Image1.ImageUrl = "~/images/employees/" + Request["empID"].ToString() + ".jpg";
asp.net Syntax (Toggle Plain Text)
if (fileUpload.HasFile) { // Get the name of the file string fileName = fileUpload.FileName; string ext = System.IO.Path.GetExtension(fileName.ToString()); if (ext == ".jpg" || ext == ".jepg" || ext == ".JPG" || ext == ".JPEG") { fileName = Request["empID"].ToString() + ".jpg"; // Upload the file on the server fileUpload.SaveAs(MapPath("~/images/employees/" + fileName)); } }
Thanks for the try to name it with different name, using time but when i want to render the image, how can I know its name without saving it??!!
Last edited by peter_budo; Jun 10th, 2008 at 12:13 pm. Reason: Keep It Organized - please use [code] tags
![]() |
Similar Threads
- image upload problem (PHP)
- Problem uploading images? (DaniWeb Community Feedback)
- uploading Images into Database (ASP.NET)
- File upload problem (PHP)
- Uploading images to the Web Server using ASP (ASP)
- problem uploading org chart with live link to intranet (Software Development Job Offers)
- Internet graphics display problem (OS X)
Other Threads in the ASP.NET Forum
- Previous Thread: How to rewrite url
- Next Thread: Validating registration details
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol feedback findcontrol flash flv form forms gridview homeedition hosting iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings relationaldatabases rotatepage save search security serializesmo.table sessionvariables silverlight smartcard sql ssl suse textbox tracking treeview typeof unauthorized validatedate validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml





. Thanks Fungus1487, I give you credit
