SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Get extension of upload Options
shedezy
#1 Posted : Thursday, May 06, 2010 4:27:09 PM
Rank: Newbie

Groups: Registered

Joined: 4/30/2010
Posts: 6

e.Status.CurrentFileName.ToString() gives me the file name, what gives me the extension?

Axosoft
#2 Posted : Thursday, May 06, 2010 4:45:48 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

If you have a filename, call Path.GetExtension to get the extension (in the System.IO namespace). Something like:

string ext = Path.GetExtension(fileName);

I would also suggest accessing the filename through the LocationInfo collection, something like:

For Each file As UploadedFile in e.GetUploadedFiles()
    Dim fileName As String = file.LocationInfo(FileUploadStreamProvider.FileNameKey);
    'do something with the filename
Next file

shedezy
#3 Posted : Thursday, May 06, 2010 4:55:12 PM
Rank: Newbie

Groups: Registered

Joined: 4/30/2010
Posts: 6

Perfect thanks!

Users browsing this topic
Guest
Forum Jump  
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.