filenames / extensions with file uploads

From: Lauchlan M (LMackinnon_at_Hotmail.com)
Date: 03/02/04


Date: Tue, 2 Mar 2004 19:22:08 +1000

Hi

I'm doing a file upload and I get

     //get the filename
     string FullFileNameAndPath = fileDischargeFile.PostedFile.FileName;

This returns the full filepath, eg c:\folder\filename.ext

What I want to do is get the filename (as 'filename.ext') and the extension
(as '.ext') from this full path.

What are the best .net methods/namespaces to use for this?

Thanks

Lauchlan M



Relevant Pages

  • Re: Excel crashing problem when saving from VB
    ... 'get the current filepath and workbook name ... specified but an IT Incident Title ... any filename you input will not be used") ... If EmailError 1 Then ...
    (microsoft.public.excel.programming)
  • Re: Excel crashing problem when saving from VB
    ... The form works perfectly in Excel 2002 sp2 but will hang in sp3. ... specified but an IT Incident Title ... any filename you input will not be used") ... 'plot the select filepath back in to theExcelsht for future saves ...
    (microsoft.public.excel.programming)
  • Com Interop interfaces generating wrong case
    ... public void send(string contents, string filepath,string filename) ... Notice how the original parameters filename and filepath have been changed ...
    (microsoft.public.dotnet.framework.interop)
  • Com Interop generating wrong cases for interfaces
    ... public void send(string contents, string filepath,string filename) ... Notice how the original parameters filename and filepath have been changed ...
    (microsoft.public.dotnet.general)
  • Re: Excel crashing problem when saving from VB
    ... Public Sub SaveRoutine() ... 'get the current filepath and workbook name ... any filename you input will not be used") ... If EmailError 1 Then ...
    (microsoft.public.excel.programming)