Welcome Guest Search | Active Topics | Sign In | Register

AJAX Uploader - Could not find a part of the path Options
peterbf
Posted: Thursday, July 31, 2008 3:44:55 AM
Rank: Newbie
Groups: Member

Joined: 7/31/2008
Posts: 1
Hello!

This is great tools! I'm very impressed and happy!

Though I have a problem.

When i'm uploading a file:
Code: C#
string finalFileName = Path.Combine("Graphics/Cards", file.ClientFileName);


I get the error message: Could not find a part of the path.

But if i type "c:/" as the first Combine Path it's working. But I want save the files in that specific folder "Graphics/Cards".

I have the authority for the Graphics-folder, so there's no problem.

What should I do?

Solution:
I added Server.MapPath("~/Graphics/Cards")

But now i want to change name on the file i'm about to upload. I want the file to have the name Guid.NewGuid() how to?
eo_support
Posted: Thursday, July 31, 2008 4:09:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
peterbf wrote:
I want the file to have the name Guid.NewGuid() how to?


Thanks for the update. It will be pretty much the same as what you were doing. You would just supply Guid.NewGuid().ToString() as the second parameter. You may also want to keep the original file name extension. However we will not be able to provide you details on those because those are generic programming questions, thus are out of the scope of our support.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.