Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350359

Summary: FileUploadReceiver does not pass filename extension
Product: [RT] RAP Reporter: Jürgen Kilian <kilian>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: austin.riddle, elena.nayashkova, john.yotka
Version: 1.4   
Target Milestone: 1.5 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
adds an edit form either to enable automatic calculation of related projects, based on project similarities, or to manually add related projects none

Description Jürgen Kilian CLA 2011-06-25 14:05:56 EDT
For  http://download.eclipse.org/rt/rap/1.4/incubator/ 

The receiver of the new FileUpload widget does not pass the original filename and - more important - its extension to the servlet container.
At least under OS-X with Jetty or Tomcat, the uploaded files get stored with a generic name and extension ".tmp".
Without the information about the filetype, the usage of uploaded files gets a bit complicated.

 See also Ralf Sternberg's reply at http://eclipsesource.com/blogs/2011/06/23/uploading-files-with-rap-14/comment-page-1/#comment-9922


Example (OS-X, Jetty or Tomcat ): 
 FileDialog fileDialog = new FileDialog( shell, SWT.TITLE | SWT.MULTI );
  fileDialog.setText( "Upload Files" );?
  fileDialog.setAutoUpload( true ); // This API will change, see below!
  fileDialog.open();
  String[] fileNames = fileDialog.getFileNames();

=> any entry in fileNames ends with ".tmp" independent of the filetype/extension of the uploaded file.
Comment 1 Elena Nayashkova CLA 2011-07-15 03:24:08 EDT
Created attachment 199726 [details]
adds an edit form either to enable automatic calculation of related projects, based on project similarities, or to manually add related projects
Comment 2 Austin Riddle CLA 2011-07-15 09:35:04 EDT
(In reply to comment #1)
> Created attachment 199726 [details]
> adds an edit form either to enable automatic calculation of related projects,
> based on project similarities, or to manually add related projects

Sorry Elena, it looks like from your comments and patch that you posted to the wrong bug, or there was a Bugzilla error.
Comment 3 Elena Nayashkova CLA 2011-07-15 09:46:41 EDT
sorry, you are right, the patch was meant for the bug 350539
Comment 4 Ivan Furnadjiev CLA 2011-07-19 03:21:14 EDT
*** Bug 350857 has been marked as a duplicate of this bug. ***
Comment 5 Ivan Furnadjiev CLA 2011-08-05 09:11:57 EDT
If the uploaded file name is "foo.bar" the temporary file name now looks like "foo.1234567890.bar". Both name and extension are preserved. Changes are in CVS HEAD.