tags:

views:

19

answers:

0

Hi All

I have a mapped drive shared with same user and password on both systems. \system1\c$\my folder\content\ to system 2. They are on the Internet and dont have private/local network. In my ASP.NET web application on System 2 i convert .flv files to mp3. Locally thing works fine but when the file is on shared directory nothing happens. The ffmpeg.exe is in wwwroot of System2.

I am impersonating the user which also deletes the original file but conversion using ffmpeg never happens. If I specify Z:\465\recording (the name of mapped drive) the code throws invalid directory exception.

Here is a snippet of my code:

    string cmd = String.Empty;
    string directory = Path.GetDirectoryName(sourceName);
    switch (vidFormat)
    {
        case VideoFormat.MP3:
            cmd = ToMP3CmdLine;
            break;
    }

    try
    {
        cmd = String.Format(cmd, sourceName, targetName);          
        ProcessStartInfo psi = new ProcessStartInfo(toolFolderPath + "\\" + ffmpeg, cmd);

        string sFullPath = toolFolderPath + "\\" + ffmpeg + "  Cmd:" + cmd;         

        psi.UseShellExecute = false;
        psi.CreateNoWindow = true;
        psi.WorkingDirectory = directory;   

        using (Process p = Process.Start(psi))
        {              
            p.WaitForExit();
            p.Close();
        }

        if (deleteOrignal)
        {
            File.Delete(sourceName);
        }

This deletes the original file but conversion fails if using unc path \system1\

Any help will highly be appreciated