MMBase

Image upload does not show image immediately

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.0
  • Fix Version/s: 1.8.4
  • Component/s: Editwizards
  • Description:
    Hide
    original bugid: #6419
    If an image is uploaded in the edit wizards, it does not show immediately on the wizard page. This is related directly to the use of the commons file upload libraries in processuploads.jsp.

    The commons file upload module keeps the uploaded file in memory if it does not exceed a certain size limit (10240 bytes), files that exceed this limit are stored by default in 'java.io.tmpdir'. The problem is that both locations can not be served by a web server. Immediately after an image upload, the source for the wizard page contains the following (uploaded aukje.gif):

    <img height="128" width="128" border="0" vspace="0" hspace="0" src="aukje.gif">

    This does not work, since aukje.gif is not located at
    http://localhost:8080/website/mmbase/edit/wizard/jsp/aukje.gif

    The XSL that renders this URL is inside the template 'ftype-image' in wizard.xsl.

    There are two solutions for this problem:
    1. Have the commons file upload code write to a directory inside the web app. The web server can then serve the image using a simple URL.
    2. Save the binary data inside the wizard and render an image from it using the ImageRequestProcessor (which should be a singleton). I have no idea whether this is doable at all.
    Show
    original bugid: #6419 If an image is uploaded in the edit wizards, it does not show immediately on the wizard page. This is related directly to the use of the commons file upload libraries in processuploads.jsp. The commons file upload module keeps the uploaded file in memory if it does not exceed a certain size limit (10240 bytes), files that exceed this limit are stored by default in 'java.io.tmpdir'. The problem is that both locations can not be served by a web server. Immediately after an image upload, the source for the wizard page contains the following (uploaded aukje.gif): <img height="128" width="128" border="0" vspace="0" hspace="0" src="aukje.gif"> This does not work, since aukje.gif is not located at http://localhost:8080/website/mmbase/edit/wizard/jsp/aukje.gif The XSL that renders this URL is inside the template 'ftype-image' in wizard.xsl. There are two solutions for this problem: 1. Have the commons file upload code write to a directory inside the web app. The web server can then serve the image using a simple URL. 2. Save the binary data inside the wizard and render an image from it using the ImageRequestProcessor (which should be a singleton). I have no idea whether this is doable at all.

Activity

Hide
Ronald Wildenberg added a comment - 1970-01-01 00:59
Update on commons fileupload behavior For retrieving the path information from an upload, in processuploads.jsp the method org.apache.commons.fileupload.FileItem#getName() is used. Depending on browser type, this method either returns the full path name or just the base name. If it would return the full path name always, the code in processuploads.jsp would be correct, however, in most cases it does not.
Show
Ronald Wildenberg added a comment - 1970-01-01 00:59 Update on commons fileupload behavior For retrieving the path information from an upload, in processuploads.jsp the method org.apache.commons.fileupload.FileItem#getName() is used. Depending on browser type, this method either returns the full path name or just the base name. If it would return the full path name always, the code in processuploads.jsp would be correct, however, in most cases it does not.
Hide
Ronald Wildenberg added a comment - 2004-04-06 13:40
Image upload does not show image immediately
If an image is uploaded in the edit wizards, it does not show immediately on the wizard page. This is related directly to the use of the commons file upload libraries in processuploads.jsp.

The commons file upload module keeps the uploaded file in memory if it does not exceed a certain size limit (10240 bytes), files that exceed this limit are stored by default in 'java.io.tmpdir'. The problem is that both locations can not be served by a web server. Immediately after an image upload, the source for the wizard page contains the following (uploaded aukje.gif):

<img height="128" width="128" border="0" vspace="0" hspace="0" src="aukje.gif">

This does not work, since aukje.gif is not located at
http://localhost:8080/website/mmbase/edit/wizard/jsp/aukje.gif

The XSL that renders this URL is inside the template 'ftype-image' in wizard.xsl.

There are two solutions for this problem:
1. Have the commons file upload code write to a directory inside the web app. The web server can then serve the image using a simple URL.
2. Save the binary data inside the wizard and render an image from it using the ImageRequestProcessor (which should be a singleton). I have no idea whether this is doable at all.
Show
Ronald Wildenberg added a comment - 2004-04-06 13:40 Image upload does not show image immediately If an image is uploaded in the edit wizards, it does not show immediately on the wizard page. This is related directly to the use of the commons file upload libraries in processuploads.jsp. The commons file upload module keeps the uploaded file in memory if it does not exceed a certain size limit (10240 bytes), files that exceed this limit are stored by default in 'java.io.tmpdir'. The problem is that both locations can not be served by a web server. Immediately after an image upload, the source for the wizard page contains the following (uploaded aukje.gif): <img height="128" width="128" border="0" vspace="0" hspace="0" src="aukje.gif"> This does not work, since aukje.gif is not located at http://localhost:8080/website/mmbase/edit/wizard/jsp/aukje.gif The XSL that renders this URL is inside the template 'ftype-image' in wizard.xsl. There are two solutions for this problem: 1. Have the commons file upload code write to a directory inside the web app. The web server can then serve the image using a simple URL. 2. Save the binary data inside the wizard and render an image from it using the ImageRequestProcessor (which should be a singleton). I have no idea whether this is doable at all.
Hide
Nico Klasens added a comment - 2007-01-03 21:10
Image should be shown from the local file system of the user. This does not work in firefox. An additional check does not show an image when firefox is used
Show
Nico Klasens added a comment - 2007-01-03 21:10 Image should be shown from the local file system of the user. This does not work in firefox. An additional check does not show an image when firefox is used

People

Dates

  • Created:
    2004-07-07 13:11
    Updated:
    2007-01-03 21:10
    Resolved:
    2007-01-03 21:10