 |
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

September 4th, 2015, 12:20 AM
|
|
Registered User
|
|
Join Date: Sep 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
path not found
Please help in this issue: I have been trying to solve this issute and the DIRECTORY DOES EXIST but keep on getting this error on the local host and deployement environment...
Server Error in '/' Application.
Could not find a part of the path 'C:\Something\Something\Something\wwwroot\GigPics\ f0dc45ae-43b5-47ae-bdc9-d808dc8dfe88\.jpg'.
|
|

September 4th, 2015, 03:49 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I think the error message is correct and the path DOES NOT exist. Take a look at this:
\f0dc45ae-43b5-47ae-bdc9-d808dc8dfe88\.jpg
It's looking for a folder called f0dc45ae-43b5-47ae-bdc9-d808dc8dfe88 that contains an unnamed file with a jpg extension. The path should likely end like this:
\f0dc45ae-43b5-47ae-bdc9-d808dc8dfe88.jpg
so it looks like an issue with the code that saves the path in the database.
Cheers,
Imar
|
|

September 4th, 2015, 08:59 PM
|
|
Registered User
|
|
Join Date: Sep 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This is my code and everything look OK, i noticed that but have no idea why its showing like this????
string virtualFolder = "~/GigPics/";
string physicalFolder = Server.MapPath(virtualFolder);
string fileName = Guid.NewGuid().ToString();
string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
FileUpload1.SaveAs(System.IO.Path.Combine(physical Folder, fileName, extension));
book.ImageUrl1 = virtualFolder + fileName + extension;
|
|

September 7th, 2015, 03:09 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What do you see in the database? Maybe this is a leftover picture from an earlier attempt? If so, clear the table and then create new pictures.
If the problem persists, you'll need to debug your code to see why this path ends up in your database.
Cheers,
Imar
|
|

September 7th, 2015, 04:34 PM
|
|
Registered User
|
|
Join Date: Sep 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The debug only shows error by highlighting .SaveChanges and no other info, also I recreated the table but still same error
|
|

September 7th, 2015, 05:06 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Try debugging the code that saves the picture and assigns the path. Does that save the correct value? What path do you see in the Pictures table?
Imar
|
|

September 8th, 2015, 10:56 PM
|
|
Registered User
|
|
Join Date: Sep 2015
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I checked the database and it is actually only saving as ~/GigPics/854648fjknhf without any extension
Please any help is appreciated
|
|

September 9th, 2015, 02:12 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Debug the code that creates the URL, saves the image on disk and adds it to the database line by line. Something is going wrong in that code but I can't tell what since you didn't post the full code.
Cheers,
Imar
|
|
 |
|