JavaPowUpload 2.2
Troubleshooting
  Home page
Contact support

Troubleshooting

Here you can find often errors and problems that can occur while working with JavaPowUpload. Some articles are joined in groups and relate to the technology of file processing code on a server side.

Any error:

If it is impossible to find reason of error, you can contact Element-IT support team. We recommend to attach java console log.
How to get output of java console: Open java control panel, advanced tab, debugging section and check "Enable tracing", "Enable logging" and "Show applet lifecycle exceptions"; Java console section and check "Show console". Restart browser (if it was opened). Open page with uploader, java console should appear. Try reproduce error, copy java console output and send it to Element-IT support team .

Any HTTP error:

Read the following paragraph in case of any problems:
JavaPowUpload shows server replies in a small-size window without possibility to see HTML code (set the value of the Common.LogArea.Visible parameter to true). By the reason, we advise to install HTTP Sniffer for testing period to see server replies and errors. You may use HTTP Analyzer (15 days trial) or free Wireshark. HTTP Sniffer is also useful for seeing which data JavaPowUpload transfers and their format.

All the HTTP errors and their short descriptions can be seen at w3.org website.

Lost session or authentication info

This issue may occur when the server marks cookies as HTTPOnly. The HttpOnly flag is an option, first introduced by Microsoft in Internet Explorer version 6 and implemented in PHP since version 5.2.0 that is intended to make a cookie inaccessible to the client side script. JavaPowUpload tries to get browser's cookie firstly using JavaScript if the Upload.HttpUpload.GetCookieUsingJS parameter is set to true. If java script is disabled and we can't get cookies by this method (document.cookie returns null), then JavaPowUpload sends an additional request to a server using native Java api.
Both of those methods can't get cookies marked as HTTPOnly.
Solution for IIS server with ASP.NET:
<httpCookies httpOnlyCookies="false" />
parameter in the web.config file of your application. For some reasons, this parameter won't work with .NET 2.0. Here is a sample global.asax file (place it in the root folder of your application) that marks all cookies as non-httponly:
<script runat="server">
void Session_Start(object sender, EventArgs e) {
if(Response.Cookies.Count > 0)
       foreach(string s in Response.Cookies.AllKeys)        
               Response.Cookies[s].HttpOnly = false;
}
</script>

ASP (ASP.OLD) file processing script

Error 403
See solution here http://support.microsoft.com/kb/327659

Write Permissions to UploadedFiles\ folder
Error like "Access to the path "C:\Inetpub\wwwroot\Upload\UploadedFiles\myfile.jpg" is denied"

The directory where the uploaded files will be saved on the web server must have Read, Write, and Delete NTFS permissions for the Anonymous or authenticated user (If Windows authentication is used):
Right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the the necessary account, and check the boxes for the desired access.

ASP.NET file processing script

Create web application in a folder with script
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS

ASP.NET code works only in folders on server with created "web application". To create: Open Control panel->Administrative tools-> Internet Information Services->Expand "Default web site", right-click on a necessary folder and select "Properties" in the context menu. In the folder properties dialog box, open "Directory" tab and click "Create" button (create Application), click "ok" .

Write Permissions to UploadedFiles\ folder
Error like "Access to the path "C:\Inetpub\wwwroot\Upload\UploadedFiles\myfile.jpg" is denied"

You should grant NETWORK SERVICE (for IIS 6) or ASPNET (IIS6) or other necessary account write access to a folder where the uploaded files will be saved, right-click on the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the necessary account, and check the boxes for the desired access.

Error "System.Web.HttpException: Maximum request length exceeded"
Upload large files

See solution here

Error "System.Web.HttpException: Request timed out"
See solution here

Error "OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown"
See solution here

IIS7 ASP.NET file processing script

HTTP Error 404.13 - Not Found
Description: The request filtering module is configured to deny a request that exceeds the request content length.

Upload files greater than 30 MB

By default in IIS 7 requestFiltering that has MaxAllowedContentLength property is enabled. It specifies, in bytes, the maximum length of the content in a request. The default is 30000000 (approximately 30 megabytes.) To change this value you must include the following code in your Web.config file if you want to apply this setting only to you application. If you want to change this setting for all of the computer and not just for this ASP.NET application, you must modify the Machine.config file. By default, the element is set to the following parameters in the Machine.config file: The Machine.config file is located in the \System Root\Microsoft.NET\Framework\Version Number\CONFIG directory.

If you have an error that the requestFiltering cannot be overriden you must edit mashine.config file and change the string:
<section name="requestFiltering" overrideModeDefault="Deny" />
to <section name="requestFiltering" overrideModeDefault="Allow" />

PHP

Information related to files upload in PHP
You can find a lot of information related to file upload in PHP code at this website http://de3.php.net/manual/en/features.file-upload.php
By default, uploadfiles.php script shows error constant. See the description of all constants related to upload at http://php.net/manual/en/features.file-upload.errors.php

php.ini settings related to upload

The most common cause of the problems related to file uploads is PHP itself. The following php.ini settings effect file uploads:

file_uploads boolean

Name

Default

Changeable

Changelog

file_uploads

"1"

PHP_INI_SYSTEM

PHP_INI_ALL in PHP <= 4.2.3. Available since PHP 4.0.3


This parameter has to be set to 1 to accept file uploads, value 0 is not to accept file uploads. Defaults to 1.

post_max_size integer

Name

Default

Changeable

Changelog

post_max_size

"8M"

PHP_INI_PERDIR

PHP_INI_SYSTEM in PHP <= 4.2.3. Available since PHP 4.0.3



This is the maximum size of a POST request that PHP will accept. The default for PHP 4.3.x is 8M. If the file(s) you are trying to upload have a single or combined size over this value, PHP will exit. This affects the total post data. For example, if it has been set to 8M and you are uploading four 3M files, PHP would not accept the files. You could, however, upload the four 3M files individually without a problem from this setting.
To upload large files, this value must be larger than upload_max_filesize.
If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. It can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set.
memory_limit integer

Name

Default

Changeable

Changelog

memory_limit

"128M"

PHP_INI_ALL

"8M" before PHP 5.2.0, "16M" in PHP 5.2.0

It sets the maximum amount of memory in bytes that a script is allowed to allocate. It helps to prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.

upload_max_filesize integer

Name

Default

Changeable

Changelog

upload_max_filesize

"2M"

PHP_INI_PERDIR

PHP_INI_ALL in PHP <= 4.2.3.



This is the maximum size of an individual uploaded file. The default for PHP 4.3.x is 2M.

max_input_time ineger


Name

Default

Changeable

Changelog

max_input_time

"-1"

PHP_INI_PERDIR

Available since PHP 4.3.0.


This is the maximum time PHP will accept input in seconds.

upload_tmp_dir string

Name

Default

Changeable

Changelog

upload_tmp_dir

NULL

PHP_INI_SYSTEM

 

The temporary directory used for storing files when doing the file upload. It must be writable by whatever user PHP is running. If it is not specified, PHP will use the system's default.


Definition of PHP_INI_* constants


Constant

Value

Meaning

PHP_INI_USER

1

Entry can be set in user scripts or in Windows registry

PHP_INI_PERDIR

2

Entry can be set in php.ini, .htaccess or httpd.conf

PHP_INI_SYSTEM

4

Entry can be set in php.ini or httpd.conf

PHP_INI_ALL

7

Entry can be set anywhere


Change Apache settings

If you do not have access to change php.ini and your website is running on apache, you may be able to include these settings in an .htaccess file. This is possible only if "AllowOverride Options" or "AllowOverride All" privileges have been set (by you, by your ISP, or by a system administrator) in httpd.conf.

If it is feasible, or if you want to try the solution on your own, create or edit a file named .htaccess (assuming you want a 6Mb max attachment size):
php_value post_max_size "7M"
php_value upload_max_filesize "6M"
php_value max_input_time "120"

Permissions

If it is a Window server nothing is required and by default window gives all permissions.

For Linux and Uinx you have to give write (Chmod) permission to both temp and destination directories to allow uploaded files to store.