Results 1 to 7 of 7
  1. #1
    sarang1 is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default Getting access denied error while importing file using input type="file" with IE7

    Hi All,
    I am using struts application wherein I need to import file for some purpose.I have used input type="file" for the same which goes like:
    <input type="file" id="uploadFile" name="uploadFile" size="50">
    I have the import button on which I have used onClick event to call javascript function submitValues() used to validate all the fields from the page which goes like:
    <input type="button" name="select" value="Import" class="CSSButton" onClick="javascript:submitValues();">
    The JS function then in turn submits the form and calls the action.The problem is sometimes even when the correct path is specified for the file to be imported results in access denied error.This error comes sometimes and other times it works fine.But when this error comes,I need to relogin into the application and then it works fine.
    Any idea why I am getting access denied error while importing? Has it got something to do with IE7 version or with the input type="file" which is being used here?
    Thanks for any help if anyone can provide.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Access denied by what? Your Web application server? I doubt that anything to do with your Javascript and what not, at least not directly.

    Does your application require authentication by the Web server? If so, how are you doing the authentication?

    I suspect, based on the sparse evidence, that your session is either timing out on the server or being lost because the session cookie is not being returned by IE.

    Check your session timeout settings. You may simply be timing out the session too quickly, especially if you are dinking around on the browser with the file upload stuff. That is especially possible, given the intermittent nature of the problem.

    Another possibility is that you are using multiple tabs or IE 7 browser windows. Each tab, or a browser window spawned by an existing window, shares the same cookies and thus the same session. If you ended the session in another tab, perhaps through another application on the same Web server, that would kill the session as well.

    There are other possibilities as well. Try to replicate the problem, being very careful to keep track of what you did to cause it.

  3. #3
    sarang1 is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    No,it has definately got nothing to do with the session coz other links from the same application works fine.They work at the same time when this error occurs.This issue doesn't come up always but comes at some times.So,it's not easily reprodicible as well.Also,I am using only one tab at a time.

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    OK, what application (IE7, the Web server, etc.) is generating the message, and what does the message say?

    Have you found a way to consistently reproduce the error? One avenue to check is if certain files on the PC you are trying to upload leads to the error. One possibility is file size.

  5. #5
    sarang1 is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    The error message is given by IE7 and it says only access is denied as a javascript error message.And I have seen the posts which mention similar issue with file upload control with .NET. But I am using java here...so just thought if it has got something to do with input type="file"?Also,file size is of no concern here as there are very few records in it.

  6. #6
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    If Javascript is giving you the error, then 99% of the time this is a purely a browser problem. If it only happens with IE7, then make that 99.9% of the time.

    JSP is only creating the HTML tag, which is purely text. Check that the tag is not malformed. Otherwise, I think we can be 99.9% sure that this is an IE7 bug.

  7. #7
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

Similar Threads

  1. trouble with Scanner(new File("input"));
    By ronyosi in forum New To Java
    Replies: 9
    Last Post: 10-28-2010, 12:34 AM
  2. Can't get my "if" statement to read user input
    By daletron3030 in forum New To Java
    Replies: 7
    Last Post: 01-16-2009, 06:24 AM
  3. "request entity too large" when downloading a 2mb file
    By arnab321 in forum CLDC and MIDP
    Replies: 4
    Last Post: 11-06-2008, 05:34 PM
  4. Replies: 1
    Last Post: 10-20-2008, 08:35 AM
  5. ".hotjava/properties" file on mac
    By willemjav in forum Java Applets
    Replies: 0
    Last Post: 03-08-2008, 01:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •