Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Workbook.Load Throw invalidcastexception
posted

I try to upload an excel file from silverlight client to server via webclient. There is my server code:

 public class FileUploadHandler : IHttpHandler
    {

public void ProcessRequest(HttpContext context)
{

           string fname = context.Request.QueryString["filename"].ToString();

           string file = context.Server.MapPath("~/App_Data/" + fname );

            using (FileStream fs = File.Create(fname))
            {
                SaveFile(context.Request.InputStream, fs);
            }

Workbook workbook = Workbook.Load(file); -- there is the code throw me error!

}

}

 

However, I can open the uploaded file using MS Excel, or Silverlight client.

The version I use is 2009V2 for siliverlight.excel and WebUI.Excel.

Chang

  • 44743
    posted

    Do you have a stack trace of the error? This will help determine what the problem is.