Uploading with swfuplaod works locally, not deployed

Discussion in 'ASP.NET / ASP.NET Core' started by splatto, Aug 6, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi All,

    I have a part of my website that allows users to upload multiple images with swfupload. I store the directory to upload to in the web.config, and have configured my local harddrive structure to reflect the same filepath for the destination folder.

    <add key="ImageTempPath" value="E:\web\yorkcentrec\htdocs\Content\Images\Temp\"/>

    Locally, it uploads each image perfectly, leaving them ready for processing. However, deployed, it does not upload to the target directory. I downloaded the folderstructure to my hardrive to do a search fror my image, and it seems it wasn't uploaded at all, not even to the wrong folder, which I had been hoping was the problem.

    Does anybody else have experience using swfupload at DiscountASP and know how to resolve this situation? Thanks,

    Matt
     
  2. Im sure its just a typo but there is a space in your path that you probably dont want there.

    In regards to the issue, do you have enough space allocated to the ASPNet user? This can be done in the user/quota manager.

    Did you change any permissions?

    Are you getting an error message? What is it?
     
  3. Yes, it is jsut a typo copy and pasted from an email. my web.config does not contain the space, but good eye!

    I have 100 megs allocated for "Anonymous ASPNet User" and have used 0megs of that.

    I'm not getting an error at all. the images just don't get uploaded to the target directory event though swfupload behaves as though they do.
     
  4. Can you post some of the codes. Specifically the Event or the Event Handler for swfupload.
     
  5. No error message business as usual?:mad:

    Thats not cool. Ok well... Im assuming the dll is in the right place and the code is correct because "It works" other wise that should throw an error.

    If you havent made any permissions changes and you have enough space allocated to the user, you should be good. Ive never heard of that plugin before but if I was you, I would look to them or their docs to try to get an error message or some sort of information.

    Who knows, maybe it wont work here or there is something else silly you looked over on accident but we need some sort of feedback. Smoke signal even, but something.
     
  6. Here is the code

    Hi everyone, thanks for your offer of support.

    The javascript that is behind my swfupload is as follows:

    Code:
    var defaults = {
                    flash_url: "swfupload.swf",
                    upload_url: "/Admin/AddPicture",
                    file_size_limit: "10 MB",
                    file_types: "*.jpg; *.jpeg; *.gif; *.png;",
                    file_types_description: "All Files",
                    debug: false
    ...
    }
    This states that after each picture is uploaded, it calls /Admin/AddPicture for processing.

    Here is the AddPicture function that saves each image that the user selects (multiple uploads are supported so this is called once for each image). For now please overlook the mess of code here, I haven't refactored this file yet.

    Code:
    public ActionResult AddPicture()
            {
                string tempPath = ConfigurationManager.AppSettings["ImageTempPath"];
    
                byte[] cacheKeyImageData = null;
                string cacheKeyFileName = null;
    
                HttpPostedFileBase hpf = Request.Files[0];
                cacheKeyFileName = hpf.FileName;
    
                if (hpf.InputStream.CanRead)
                {
                    long length = hpf.InputStream.Length;
                    cacheKeyImageData = new byte[length];
                    hpf.InputStream.Read(cacheKeyImageData, 0, Convert.ToInt32(length));
                }
                else
                {
                    //return error view
                }
    
                string StrFileName = cacheKeyFileName.Substring(cacheKeyFileName.LastIndexOf("\\") + 1);
                StrFileName = StrFileName.Replace(' ', '_');
                DoSaveImage(cacheKeyImageData, StrFileName, tempPath, 600);
                tempPath += StrFileName;
    
                //load resized image
                var image = Image.FromFile(tempPath);
                cacheKeyImageData = imageToByteArray(image);
    
                DoCacheImage(ref cacheKeyImageData, ref cacheKeyFileName, hpf);
    
                //return success view
            }
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page