Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0

    Cffileupload errors (401)


    I'm trying to use CF9's new cffileupload tag and allow multiple file uploading. However, it is not working as planned due to what seems to be a permissions error. We have created a generic user for the coldfusion service and applied this to the CF temp directory as well as the final destination directory. This setup seems to work 80% of the time in IE (I found one scenario to make it fail) and not at all in Chrome (gives the 401 error).

    For simplistic reasons, the main page has:
    Code:
    <cffileupload url="http://<mydomain>/fileupload.cfm" name="attachments" align="center" maxuploadsize="30" title="Attachments" height="200" width="600" bgcolor="DCDCDC" />
    The fileupload page has:
    Code:
    <cffile action="upload" destination="\\<server>\<folder>\" nameconflict="makeunique" />
    Obviously, <mydomain> and \\<server>\<folder> are filled in with the necessary information for my setup

    Any ideas that I may be missing on getting this to work properly?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    I don't see anything wrong, so it definitely looks like a permissions issue on either the fileupload.cfm or the destination used for the actual cffile. You might check the web server and OS logs on the servers to see if you can identify any pattern.
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    I appreciate the help. I have already went through that link so much that my head hurts and I still couldn't get anything to work properly.

    Also, as I mentioned in my original post, we went in and added the generic user that the CF service uses and made sure it had proper permission on BOTH the destination directory as well as the CF temp directory that cffile uses when it uploads. This fixed the original 401 error that we got in IE, but it doesn't help one bit for chrome. No clue where to turn next...
  8. #5
  9. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Are you passing the session ID in the file upload URL (as shown on Ray's blog)?

    If it works in IE but not in Chrome then it still sounds like an NTLM problem, since IE can use it but non-MS browsers can't. My only advice at that point is to run it by a system admin who fully understands the server setups, your permissions/Active Directory policies, etc.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    I have tried both with and without the session ID and neither seem to work for Chrome.

    That's one of the problems we have here. People on the server side only THINK they know what is going on and we are not allowed to do their jobs. I'd be willing to bet something is set up wrong and they don't even realize. Seems like it would be something dumb at this point..

    I guess from here, what exactly is the differences on how the browsers interact with the server? Meaning, why would it work in IE and not Chrome? Is it just an inherited understanding of security being both MS products or is it something more?
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    There are many subtle differences between the browsers, but the main one I'm thinking of is that NTLM authentication is a Windows-only authentication scheme. So most of the other browsers either don't support it, partially try to support it, or may have issues with supporting it.

    Does it work in Firefox or Safari? Also, is it the latest version of Chrome?
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    Yes Chrome is the latest version and no it does not seem to work in any other browser other than IE.

    What I do not understand is how cffile works just fine until used in conjunction with cffileuploader for multiple uploads. Baffles me.
  16. #9
  17. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    I'm honestly not sure, but I've never had to use it in a situation where the files were being saved on a separate server.

    Does it work all right if you change the code to save the files to a temp directory ON the CF server? That would tell you if the problem is in the move of the files from the CF box to the other machine.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    No it does not. I tried uploading to a folder in my website that is on the same server as well as just uploading to the getTempDirectory() path. All still gives the same 401 error.
  20. #11
  21. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    In that case, if it works when saving the files on the same server with IE, but does not in Chrome, then it must be some sort of permissions or authentication issue.
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    Yes that is what I thought it was from the beginning hence the 401 errors. However, we have a generic user on the network set up for the CF service and have that set up with full permissions where needed and it still doesn't work anywhere but in IE. Wasn't sure if there was more to it or a different user that it tries to use etc.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    The thing that gets me is if I create a basic form with the enctype set and do a single file input and send that to the SAME cffile upload page it works just fine from everywhere.

    That being said, what is so different from that and cffileupload as far as permissions go? Is it because of the flash?
  26. #14
  27. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    Did you try passing the session/jsessionid (as Ray discussed in the blog entry I sent earlier)?

    There really shouldn't be any difference between Flash and an HTML form, since both should just be doing HTTP POSTS under the hood. Nor can I think of a reason why IE would do something special that the other browsers don't do...
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0
    Yes i tried passing the sessionids across and no luck. I even tried to see what they were ON the upload page and I couldn't get that to run either. Appending to a log file, cfmail myself, nothing. I'm just going to give in and make the users upload 1 file at a time so I know it works. Lucky for this instance they never upload more than 2-3 at a time anyway so it's not a big deal.

    If you ever have an epiphany moment and realize something we forgot or anything I guess let me know. Thanks.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo