NotFound Error on Upload, 0 Bytes on Download

Jan 26, 2012 at 12:11 AM
Edited Jan 26, 2012 at 12:15 AM

I've been working on a Silverlight internal Sales Information site for about a year now and I've tried making File Download Proxy equivalent resources for it several times without success. Today I stumbled across your page and was like.. WOW, why didn't I see this before? The UI looks streamlined and exactly the kind of thing that I need.

However, after following the examples in Documentation, I was unable to successfully integrate the code. There are two separate issues (one with uploading and one with downloading). I'm afraid I can't seem to find the right combination of points to make this stuff work. For the moment, I just want the ability to push a file to a folder on my server as well as download a file from that server and save it to the user's system (My Documents or the IsolatedStorage, not sure which I want to do yet, doesn't really matter there). I wil worry about more advanced things like storing to a database, etc later.

Win7 communicating to a Win2k8R2 server with latest IIS updates. Note that in place of appname and fqdn I have my actual values.

Issue 1: Uploading Files

Followed the Quick Start example with the following exceptions:

  • In Button_Click I inserted the following line (It's a sub-app)
    udialog.UploadUri = "appname/fileupload.ashx";
    • I've also tried https://[fqdn]/appname/fileupload.ashx and fileupload.ashx
  • In UploadHandler.cs I set the FileStoreFolder variable to appname/Repository
    • Ive also tried Repository
  • In Web.config I set the path on the handler to https://[fqdn]/appname/FileUpload.ashx
    • I've also tried appname/FileUpload.ashx and FileUpload.ashx

When I run the site in dev, it sucessfully passes and pulls the selected file into my dev's folder. When I run the site live, I get the NotFound error.

Issue 2: Downloading Files

Followed the Download without showing a Dialog Async example with no exceptions. In dev, I get a file that is created with 0 bytes. In live, I get a NotFound error.

SideNote: Do you have a sample project with all of this showing working in a sub-app type environment to see if I can just diff files until I find the problem?

Jan 26, 2012 at 6:18 PM

Thanks for considering Interlink.

As far as your upload error, ensure you worker process has permissions to create folders/files. that is usually the case going from dev to prod.

For the download can you provide some more details? it may be file access permissions. Can you try navigating directly to file itself and see it that works?

Jan 26, 2012 at 6:49 PM

Before starting, I had my server admin (we're in the same lab) set Everyone to Full Control on that directory (C:\inetpub\wwwroot\appname\Repository\)so that there wouldn't be any permissions issues.

When I navigate to https://[fqdn]/appname/Repository/tempfile.pdf it does come up in internet explorer.

Jan 26, 2012 at 8:44 PM

Is your project a 'Web Site' or a 'Web App' ?

Jan 26, 2012 at 8:46 PM

Can you share the relevant portions of your prod web config?

Jan 26, 2012 at 10:03 PM

Web page that consists entirely of the silverlight app, installable to user's system as OOB mode for offline use (often in front of a customer and still needing information about products where there's no wireless connectivity).

Here is my XML file with the security parts removed. In addition to this, I'm using DevExpress for advanced Reporting and other controls and I communicate with a SQL database on the same server (in a different path).

<?xml version="1.0" encoding="utf-8"?>
    <sectionGroup name="system.serviceModel">
      <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
    <sectionGroup name="devExpress" type="System.Configuration.ConfigurationSectionGroup, System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <section name="xpf.printing" type="DevExpress.Xpf.Printing.Service.ConfigSections.PrintingServiceSection, DevExpress.Xpf.Printing.v11.1.Service, Version=, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          <add name="ServiceModelMessageLoggingListener">
            <filter type="" />
      <source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true">
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          <add name="ServiceModelTraceListener">
            <filter type="" />
      <add initializeData="..\Web_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
        <filter type="" />
      <add initializeData="..\Web_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
    <trace autoflush="true" />
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Server=fqdn\appname01;Database=web01;User ID=sa2;Password=p@ssw0rd" />
    <add name="ApplicationServices" connectionString="Server=fqdn\appname01;Database=aspnetdb;User ID=sa2;Password=p@ssw0rd" />
    <add name="web01Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=fqdn\appname01;initial catalog=web01;persist security info=True;user id=sa2;Password=p@ssw0rd;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="web01ConnectionString" connectionString="Data Source=fqdn\appname01;Initial Catalog=web01;Persist Security Info=True;User ID=sa2;Password=p@ssw0rd" providerName="System.Data.SqlClient" />
    <add name="xpf.printing" connectionString="XpoProvider=MSAccess;Provider=Microsoft.Jet.OLEDB.4.0;Mode=Share Deny None;data source=|DataDirectory|/ReportService.mdb;user id=Admin;password=;" />
    <compilation debug="true" targetFramework="4.0">
        <add assembly="System.Web.Abstractions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,POST" path="https://fqdn/appname/FileUpload.ashx" type="HSS.Interlink.Web.FileUpload, HSS.Interlink.Web" />
      <add verb="GET,POST" path="https://fqdn/appname/FileDownload.ashx" type="HSS.Interlink.Web.FileDownloadAsync, HSS.Interlink.Web" />
    <globalization culture="auto" uiCulture="auto" />
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
    <roleManager enabled="true">
        <clear />
        <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="FriendlyName" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
    <!--<pages pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
           pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
           userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <add assembly="System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc"/>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="FileDownload" verb="GET,POST" path=https://fqdn/appname/FileDownload.ashx type="HSS.Interlink.Web.FileDownloadAsync, HSS.Interlink.Web"/>
      <add name="FileUpload" verb="GET,POST" path=https://fqdn/appname/FileUpload.ashx type="HSS.Interlink.Web.FileUpload, HSS.Interlink.Web"/>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxSizeOfMessageToLog="4194304" />
        <behavior name="ReportServiceRestBehavior">
          <webHttp />
        <behavior name="ReportServiceBehavior">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
      <service behaviorConfiguration="ReportServiceBehavior" name="AppName.Silverlight.Web.ReportService1">
        <endpoint binding="basicHttpBinding" bindingConfiguration="ReportServiceBinding" contract="DevExpress.XtraReports.Service.IReportService" />
        <endpoint address="rest" behaviorConfiguration="ReportServiceRestBehavior" binding="webHttpBinding" bindingConfiguration="ReportServiceRestBinding" contract="DevExpress.Xpf.Printing.Service.IExportServiceRest" />
        <!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
        <binding name="ReportServiceBinding" receiveTimeout="00:10:00" maxReceivedMessageSize="4294967296" transferMode="Streamed">
          <!--<security mode="None"/>-->
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
        <binding name="ReportServiceRestBinding" receiveTimeout="00:10:00" transferMode="Streamed">
          <!--<security mode="None"/>-->
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
    <client />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
        <network host="" port="25" />
      <documentStore keepInterval="86400000" connectionStringName="xpf.printing" />
    <!-- This value must match the Full TypeName including the namespace of your UploadHandler -->
    <add key="UploadHandler" value="AppName.Silverlight.Web.UploadHandler, AppName.Silverlight.Web"/>
    <add key="DownloadHandler" value="AppName.Silverlight.Web.DownloadHandler, AppName.Silverlight.Web"/>
Jan 26, 2012 at 10:20 PM


1. IIS: is your apppool running in integrated mode?
2. DEV: is your app (project) a 'Web Application' or a 'Web Site'?
3. APP: Are you running out of browser (OOB)?

Jan 27, 2012 at 11:16 PM

Just checking in to see if you are still having issues?

The questions I had previously are not directly related to Interlink but the configuration within IIS.

If you're app is a web app, you have to write your upload handler in separate dll because ASP.NET dynamically compiles and mangles the namespacing. And if you're running out of browser, then you have to specify an absolute URI on the client side back to your handler.

And if you're running in integrated mode, you don't need handlers in the system.web config section and IIS should actually fail to run if you do. If it's not in integrated mode then you don't need the system.webserver config section.

Also, we recommend to use relative pathing.

Feb 3, 2012 at 9:21 PM

Sorry I haven't been able to respond. I have been pulled into a SEV1 project that demands full attention. I will get some more info to you mid next week.