Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350359 - FileUploadReceiver does not pass filename extension
Summary: FileUploadReceiver does not pass filename extension
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Incubator (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 350857 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-25 14:05 EDT by Jürgen Kilian CLA
Modified: 2011-08-05 09:11 EDT (History)
3 users (show)

See Also:


Attachments
adds an edit form either to enable automatic calculation of related projects, based on project similarities, or to manually add related projects (32.07 KB, patch)
2011-07-15 03:24 EDT, Elena Nayashkova CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.