This project is read-only.
1
Vote

FileInfo throws System.ArgumentException if the file name is not initialized

description

If the 'ReceivedFileName' property is not promoted, FileInfo(string) throws an ArgumentException in ArchiveComponent.IComponent.cs, void ArchiveToFile.

Fix:
string origFileName = String.Empty, origFileNameExt = String.Empty;

//Get Filename without paths
if (!string.IsNullOrEmpty(fileName))
{
    FileInfo fInfo = new FileInfo(fileName);
    origFileName = fInfo.Name;
    origFileNameExt = fInfo.Extension;

    ////Remove Extension
    if(!string.IsNullOrEmpty(origFileNameExt))
        origFileName = origFileName.Replace(origFileNameExt, "");
}

comments