I asked this on Overflow, but they thought I might get a better response here, so I'm repeating.
'm trying to get a webpart deployed and using a Silverlight webpart with an upload control inside. I am however, receiving the following error in the application log when I access my ashx.
Exception information: Exception type: HttpParseException Exception message: Could not create type 'FileUploadSP.UploadHandler'.
I've got an UploadHandler.cs file with the following code:
namespace FileUploadSP
{
public class UploadHandler : RadUploadHandler
{
public override void ProcessStream()
{
base.ProcessStream();
if (this.IsFinalFileRequest())
{
string filename = this.Request.Form["RadUAG_fileName"];
string fullPath = @"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\FileUploadSP\FileTemp\";
SPContext.Current.Web.AllowUnsafeUpdates = true;
FileStream fs = new FileStream(fullPath + filename, FileMode.Open);
SPContext.Current.Web.Files.Add("/UploadLibrary/" + filename, fs, true);
fs.Close();
File.Delete(fullPath + filename);
}
}
}
And I have the following in my .ashx file:
<%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="FileUploadSP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c8e2c3ef53023ee" %>
<%@ WebHandler Language="C#" Class="FileUploadSP.UploadHandler" %>
I cannot get the .ashx to work as I expected to. What am I missing?
Thanks!