Re: FileName of downloaded file

  •  09-16-2009, 2:49 PM

    Re: FileName of downloaded file

    I went throught the API and realize the "true" filename is args.FileName
    but that is not what I am asking.

    Example:
        A user uploads a file  "temp1.xml".
        but in the temporary download folder it is called:
            persisted.630f0c11-2cc1-4a77-ba91-0b177f23772b.temp1.xml.resx  
            
    Before I can copy the file to the destination folder,
    I have to make sure the destination folder doesn't contain
    a file called "temp1.xml".

    If another file already has a name of "temp1.xml" in the destination folder,
    I need to rename the newly downloaded file:
        temp1.xml
        to
        temp1_001.xml   <<< notice the "_001"

    Without the temporary filename of
        persisted.630f0c11-2cc1-4a77-ba91-0b177f23772b.temp1.xml.resx

        I need to copy the file using
        args.CopyTo("special_Folder__NOT_destination_folder")  
        and then rename the file to temp1_001.xml
        and then again copy it to the true destination folder.

    Instead of doing a double-copy just to rename the file to "*_001.xml",
        I would like to rename the file myself from:
        persisted.630f0c11-2cc1-4a77-ba91-0b177f23772b.temp1.xml.resx
        to
        temp1_001.xml
        and then copy it to the destination folder.
        
    It means a single file copy instead of the double file copy.

    Thus, I need someway to get the filename called:
        persisted.630f0c11-2cc1-4a77-ba91-0b177f23772b.temp1.xml.resx
        but I do not see anything in the API about that.

    Is there anyway to get that filename? (persisted.630f0c11-2cc1-4a77-ba91-0b177f23772b.temp1.xml.resx)
        
    Thanks,
    Gene
    Filed under:
View Complete Thread