This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 25, 2011, 5:28 PM
4 Posts

Re: Get filepath of uploaded file

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: file upload,file path
  • Replies: 14
Mark,
 
Per your suggestion, I disable the file renaming option, but it did not affect my issue.  I've left it disable and ran a few more tests.
It appears that the fileData variable is not getting set

From the Console:
HTTP JVM: **** in beforeRenderResponse
HTTP JVM: **** Code Line 1:  var con = facesContext.getExternalContext
HTTP JVM: **** con is NOT null

HTTP JVM: **** Code Line 2: var request:com.sun.faces.context.MyHttpServletRequestWrapper = con.getRequest
HTTP JVM: **** request is NOT null

HTTP JVM: **** Code Line 3: var map:java.util.Map = request.getParameterMap
HTTP JVM: **** map is NOT null

HTTP JVM: **** Code Line 4: var fileDataName = "file"
HTTP JVM: **** fileDataName NOT null
HTTP JVM: **** fileDataName = file


HTTP JVM: **** Code Line  5:  var fileData:com.ibm.xsp.http.UploadedFile = map.get( fileDataName )
HTTP JVM: **** fileData IS null

HTTP JVM: **** Code Line  6: var tempFile:java.io.File = fileData.getServerFile
HTTP JVM: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript action expression

Thank you for you time.
 
Regards,

Dan
dlarson@synerjetic.com
Mar 25, 2011, 7:56 PM
39 Posts
Re: Get filepath of uploaded file
If you just need the path in the file upload control, is there any reason why you aren't just doing it on the client side and then putting into a hidden text field so the server side can access it?
 
 
Mar 26, 2011, 7:43 AM
261 Posts
Re: Get filepath of uploaded file
The sample I've described in my blog post can be used to create an XPage that can handle files that are (HTTP) POSTed to it.

To post a file to such an XPage you'd need to create (for instance) a HTML page, containing a file upload, with the form method set to POST and the action to the location of the XPage.
 
It's probably possible to change the code so it can handle a file upload contained on it, but I haven't tested that. The could would probably have to be moved to the querySaveDocument event.
 
Mark

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal