Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 203690 Details for
Bug 358248
File upload handler does not return actual selected filename
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for parent directory creation with hash
fileupload.patch (text/plain), 2.03 KB, created by
Austin Riddle
on 2011-09-20 10:47:37 EDT
(
hide
)
Description:
Patch for parent directory creation with hash
Filename:
MIME Type:
Creator:
Austin Riddle
Created:
2011-09-20 10:47:37 EDT
Size:
2.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap >Index: incubator/supplemental/fileupload/org.eclipse.rap.rwt.supplemental.fileupload/src/org/eclipse/rap/rwt/supplemental/fileupload/DiskFileUploadReceiver.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/incubator/supplemental/fileupload/org.eclipse.rap.rwt.supplemental.fileupload/src/org/eclipse/rap/rwt/supplemental/fileupload/DiskFileUploadReceiver.java,v >retrieving revision 1.3 >diff -u -r1.3 DiskFileUploadReceiver.java >--- incubator/supplemental/fileupload/org.eclipse.rap.rwt.supplemental.fileupload/src/org/eclipse/rap/rwt/supplemental/fileupload/DiskFileUploadReceiver.java 5 Aug 2011 14:13:22 -0000 1.3 >+++ incubator/supplemental/fileupload/org.eclipse.rap.rwt.supplemental.fileupload/src/org/eclipse/rap/rwt/supplemental/fileupload/DiskFileUploadReceiver.java 20 Sep 2011 14:44:15 -0000 >@@ -48,7 +48,7 @@ > > /** > * Creates a file to save the received data to. Subclasses may override. >- * >+ * > * @param details the details of the uploaded file like file name, content-type and size > * @return the file to store the data in > */ >@@ -57,7 +57,21 @@ > if( details != null && details.getFileName() != null ) { > fileName = details.getFileName(); > } >- return File.createTempFile( createPrefix( fileName ), createSuffix( fileName ) ); >+ StringBuilder parentFileName = new StringBuilder( fileName ); >+ parentFileName.append( "." ); >+ File parentDir = File.createTempFile( parentFileName.toString(), "" ); >+ // [ar] by default, a file is created. >+ parentDir.delete(); >+ File targetFile = null; >+ if( parentDir.mkdir() ) { >+ parentDir.deleteOnExit(); >+ targetFile = new File( parentDir, fileName ); >+ } else { >+ String prefix = createPrefix( fileName ); >+ String suffix = createSuffix( fileName ); >+ targetFile = File.createTempFile( prefix, suffix ); >+ } >+ return targetFile; > } > > private String createPrefix( String fileName ) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 358248
: 203690