These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

File upload to C:\ fails

This a great component. Very easy to use. The new flash upload feature in v1.5 is awesome.

I am having one problem. I am unable to upload files to local drive root folders (c:\). An unhandled exception occurs (see below).

Using Flash, the Upload Files dialog indicates it worked but the file is not there.

The non-flash version reports an Alert "An error occured: Access to the path 'C:\test.exe' is denied."

The same file uploaded to c:\temp\ (or any other subdirectory) works. The NTFS security permissions are identical for c:\ and c:\temp\. Also, everything works fine if I use VisualStudio's development server.

My environment includes FileVistaControl v1.5, ASP.Net 2.0, IIS 6, Windows 2003, IE 7, FireFox, and Safari. I have also included an ASPX file (below) that can be used to recreate the problem.

Any assistance you could provide would be great. Thanks.

Shaun M.


P.S.- I thought you might like to know about some invalid urls showing up in the IIS log file.
  (bad)  2008-05-08 16:24:42 127.0.0.1 GET /scripts/swfupload/swfupload_f9.swf
  (good) 2008-05-08 16:24:42 127.0.0.1 GET /FileVistaControl/scripts/swfupload/swfupload_f9.swf
My work around was to create a /scripts/swfupload/ folder and copy the SWF file into it.


----------
Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 5/8/2008 12:46:33 PM 
Event time (UTC): 5/8/2008 6:46:33 PM 
Event ID: 187907d4894f4d16bb3748ce98858673 
Event sequence: 174 
Event occurrence: 7 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/1743331252/Root-2-128547428904120000 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Inetpub\test\ 
    Machine name: TEST 
 
Process information: 
    Process ID: 3104 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 
 
Exception information: 
    Exception type: HttpException 
    Exception message: An unhandled exception occured in the upload module. 
 
Request information: 
    Request URL: https://localhost:443/FileVistaControl/upload.aspx?rootFolderID=0&relativePath=&ASP.NET_SessionId=ckastema1124tk3lbxfy02mh&FT.Active=1&FT.OverrideProvider=1&FT.UploadID=12102723933963327 
    Request path: /FileVistaControl/upload.aspx 
    User host address: 127.0.0.1 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
 
Thread information: 
    Thread ID: 6 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at GleamTech.Web.FileTransfer.UploadHttpModule.a(Object A_0, EventArgs A_1)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
----------

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>FileVistaControl Test</title>
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        string Path = TextBox1.Text;
        if (String.IsNullOrEmpty(Path)) Path = "C:\\";
        TextBox1.Text = Path;
        Boolean Flash = CheckBox1.Checked;
        Boolean Debug = CheckBox2.Checked;
        //Create and initialize FileVista Control
        if (System.IO.Directory.Exists(Path))
        {
            //Programatically create the FVC control for ePackage Files
            GleamTech.Web.Controls.FileVistaControl fvcFiles = (GleamTech.Web.Controls.FileVistaControl)LoadControl("~/FileVistaControl/filevista.ascx");
            //fvcFiles.LicenseKey = "";
            fvcFiles.Style = "width: 100%; height:600px";
            fvcFiles.Visible = true;
            if (Flash) fvcFiles.UploadMethod = GleamTech.Web.Controls.UploadMethod.Flash;
            else       fvcFiles.UploadMethod = GleamTech.Web.Controls.UploadMethod.Browser;
            fvcFiles.Debug = Debug;
            GleamTech.Web.Controls.FileVistaRootFolder Folder1 = new GleamTech.Web.Controls.FileVistaRootFolder(Path, Path);
            Folder1.Permissions = GleamTech.Web.Controls.FileVistaPermissions.Full;
            fvcFiles.RootFolders.Add(Folder1);
            Placeholder1.Controls.Add(fvcFiles);  //add FVC to placeholder control
        }
    }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <h1>FileVistaControl Test</h1>
    <b>Path: </b><asp:TextBox ID="TextBox1" runat="server" />&nbsp;&nbsp;&nbsp;
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Use Flash" Checked="true" />&nbsp;&nbsp;&nbsp;
    <asp:CheckBox ID="CheckBox2" runat="server" Text="Enable debug" Checked="true" />&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button1" runat="server" Text="OK" /><br />
    <asp:placeholder ID="Placeholder1" runat="server" />
    </form>
</body>
</html>
Shaun M. 5/8/2008 1:12 PM
To solve permission problems, please first identify the correct user that the application is running in the context of. For instance, when connecting to VisualStudio's development server, the app is run under the currently logged in Windows user but when connecting to IIS, the executing user is determined by IIS settings. 

So you need to find out which user the app is actually impersonating.
Edit FileVista\App_Data\FileVista.config and set the value of key IsConfigurationComplete to 0.
Run configuration.aspx and see the name of current executing user, do not proceed to next pages.

Then please make sure that the impersonated user has permissions on the folder in question.
Cem Alacayir 6/2/2008 6:35 PM
FYI, in v1.5.7 the invalid urls (appeared in IIS log) are prevented.
Cem Alacayir 6/20/2008 7:56 AM