Click here to Skip to main content
16,021,125 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
so basically i wrote code for importing excel and saving it on godaddy domain but if i try to run this code it shows me error the uploader could not exists in current context what m missing here?
code is:
C#
private String uploadAttachmentOnServer(FileUpload fileUpload)
    {
        String fileName = null;
        int filesize = 0;

        try
        {
            fileName = fileUpload.FileName;
            filesize = fileUpload.FileBytes.Length;
            String fileType;
            String fileSize;
            String destinationPath = Server.MapPath("./ExcelFiles/"); // ExcelFiles is folder name

            String extension = Uploader.fileUpload(fileUpload, destinationPath, out fileType, out fileSize);
            String fileVirtualPath = null;
            if (extension != null)
            {
                fileVirtualPath = "../ExcelFiles/" + fileUpload.FileName;
                return destinationPath + extension;
            }
            return null;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return null;
    }
Posted
Comments
F-ES Sitecore 8-Sep-15 4:12am    
What's "Uploader"?

1 solution

What is "Uploader" in your code line

String extension = Uploader.fileUpload(fileUpload, destinationPath, out fileType, out fileSize);


as you used it in your code It must be a either a class with static method fileUpload()

or you are using any .dll in your code and not adding it at top as using statement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900