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



Apr 18, 2013, 1:32 AM
90 Posts

Validate in file upload control that a PDF has been uploaded

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: File upload control validation
  • Replies: 4
 Is there a way to validate, in a file upload control, that a PDF has been uploaded and no other file format?
 
Many thanks, Randal.
Apr 18, 2013, 6:21 AM
54 Posts
Re: Validate in file upload control that a PDF has been uploaded
In the file Upload control - All Properties - basics - accept
Apr 18, 2013, 7:49 AM
17 Posts
Re: Validate in file upload control that a PDF has been uploaded
 
in the property accept  specify the type of the desired file as "application/pdf"
 
I allow images, pdf and msword files in my upload as in (suppose could be a static value as well)

<xp:this.accept><![CDATA[${javascript:"image/gif,image/jpeg,image/pjpeg,image/png,image/bmp,image/tiff,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"}]]></xp:this.accept>   
Apr 18, 2013, 2:43 PM
90 Posts
Re: Validate in file upload control that a PDF has been uploaded
Amazing, thank you both, it works.

 
I see that it just blanks out the upload field, with no word of explanation; I wonder if there's a way to communicate with the user why their upload got blanked out. 
Apr 18, 2013, 3:32 PM
54 Posts
Re: Validate in file upload control that a PDF has been uploaded
One way is to use an error control for the fileUpload control.

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