Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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!

share|improve this question
    
what is RadUploadHandler, and is it also deployed ? –  Steve B Sep 22 '11 at 5:30
add comment

1 Answer

a bet : the ashx requires the FQDN of the assembly. Try this :

<%@ WebHandler Language="C#" Class="FileUploadSP.UploadHandler, FileUploadSP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c8e2c3ef53023ee" %>
share|improve this answer
    
Nope, that last one didn't make a difference. The RadUpload thing is a silverlight control from Telerik. I'm wondering if I need to include the IHttpHandler there instead, but then the RadUpload wouldn't work. I will try that and remove the Telerik stuff just to see if that fixes it. –  PixelMuse Sep 22 '11 at 17:22
    
Ok, I was wrong, that seems to have taken care of the original error, but now I'm getting a new one. Exception information: Exception type: HttpParseException Exception message: Exception of type 'System.Web.HttpParseException' was thrown. –  PixelMuse Sep 22 '11 at 17:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.