Search This Blog

Tuesday, October 20, 2015

Handy File Attachment Utilities To Consider

Couple of utilities that provides more flexibility to the attachment framework.

1. Restricting the File Type for the upload
This utility allows you to create a filter for the type of documents which are allowed for the upload. This provides more control for the File Attachment Framework and less worry on the malicious file uploads to the system.

The file type list can be created from the below page. There are two options which can be used here.

  • Relative: The system allows the file types which are in the Contained Extensions grid and with the status of Accept
  • Absolute: To utilize the standard list of file types (available file types given below). You can pick any file type from the standard list and exclude it with a Reject status or add a new file type with an Accept status, which will be considered with the standard list.


Below are the standard list of file types which are currently available.


Now to enforce the file type filtering, you have to associate the File Extension List to the URL Maintenance page.


To do this, click on the URL Properties link which will open the properties page. Here, select FILE_EXT_LIST as the Property Name and provide the file extension which you created as the Property Value.


Administers can upload any type of file names even though this restriction exist. For this they need to have the PTFX Ignore Download Ext Lists attached to their user profile.

2. Copying and Deleting the attachments in batch
We can use the Copy and Clean Attachments using peoplecode for managing files during a transaction. However, if there are large attachments involved in the process, it is recommended to use the batch processes to avoid the PIA timeouts and page freezes.

  • COPYATTS Application Engine program for the batch attachment copy (which uses the CopyAttachments function behind the scenes, which is again a combination of Get and Put attachments)
  • CLEANATT84 Application Engine program for the batch orphan file clean ups (which uses the CleanAttachments function).
So make the File Attachment Framework more robust with these delivered utilities.

Friday, October 16, 2015

How To Control The Size Of The Image Uploaded

There are several scenarios where a certain size of an image is expected for the best results.

Couple of examples are:
  • Photo uploads with a standard size expectation for official document prints,which the user might not stick to, regardless of the image size instructions provided.
  • The images should adhere to the standard image size for the best UX experience, which is again managed by the user.
These typical scenarios can result in non-satisfactory results if a control system is not in place.


Sigh!!! Captain is not uploading it right.

The best method to keep the standard in place is to provide the ability to the user to crop their images upon the upload (all the new websites does this anyway to control the profile picture size for example). PeopleTools has new set of functions which can be used to implement this feature.

Here is how:

User clicks on the 'Upload Your Photo' button
The click launches the crop window with the crop frame which the user can drag or expand to select area within the restricted size constraints
Click OK button to complete the crop

Then you have the cropped version of the image ready to store in the database or file server
The implementation part is pretty simple. It is all about using two delivered functions.

  • InsertImage(RECORD.FIELD);
    • This function assigns the image to a field on the page, which then can be referred in the crop function
  • CropImage(RECORD.FIELD (source: the above one), RECORD.FIELD (target: which can be used for display and save), &width, &height);
    • This function launches the crop interface, which is the best part of this feature.
    • &width, &height controls the crop frame. Set if for a specific situation to be handled.
That's it.

PS Online Help Is Responsive (Partially)

Seems like everything related to PeopleSoft is turning 'responsive' now. Noticed that the HCM online documentation is fluidic. And it is only HCM help at this moment.

It is more convenient to browse on mobile now.