File Upload widget PUIUPLEXIT

Use this board to ask questions or have discussions with other Genie users.
Post Reply
Wayne C.
Experienced User
Posts: 139
Joined: Mon Aug 16, 2010 12:04 pm
First Name: Wayne
Last Name: Colasinski
Company Name: Sofworx / Tantara Transport
Contact:

File Upload widget PUIUPLEXIT

Post by Wayne C. »

We are considering using the File Upload widget in Genie to upload a file from one of our vendors. Does the program PUIUPLEXIT have to be modified or is it usable and safe in its original state? Any other things to be considered regarding this?

Thanks in advance.
Wayne C.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: File Upload widget PUIUPLEXIT

Post by David »

The PUIUPLEXIT program object is not shipped with Profound UI. We ship a 'skeleton' source member. It will not allow any uploads to occur if you use the 'skeleton' source without any changes. It's up to you to actually implement the logic and create the program.

This program controls security for the file upload. The idea is that Profound UI provides this program with some information about the transaction. For example, the user who is trying to upload a file, where they are trying to upload it to, the size of the file, etc. And then the program decides whether or not to allow the upload to happen.

It's very important to read over the documentation thoroughly and code the program so that only valid uploads are allowed. Let me know if there are any questions on it, I'd be glad to help.
Wayne C.
Experienced User
Posts: 139
Joined: Mon Aug 16, 2010 12:04 pm
First Name: Wayne
Last Name: Colasinski
Company Name: Sofworx / Tantara Transport
Contact:

Re: File Upload widget PUIUPLEXIT

Post by Wayne C. »

Is there anyway that you or another Profound/Genie user could provide us with an example of a functioning program? We read the documentation and there are things that we're fuzzy on, but it would go along way in clearing some things up if we could see a functioning program.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: File Upload widget PUIUPLEXIT

Post by Scott Klement »

Wayne, here's a very simple example that only allows access to one particular IFS directory.
If there are things you are unclear on, please ask.

Code: Select all

     H DFTACTGRP(*NO) ACTGRP(*CALLER)

     D* DS template for FileInfo parameter.
     D fileinfo_t      DS                  Qualified Based(Template)
     D  WidgetId                    256A
     D  Directory                   256A
     D  Name                        256A
     D  Type                        256A
     D  Size                         10U 0
     D  Exists                         N

     D* Do not change the prototype.
     D Main            PR                  ExtPgm('PUIUPLEXIT')
     D  FileInfo                           Const LikeDS(fileinfo_t)
     D  Allow                         5I 0
     D  ErrorMsg                    256A

     D* Do not change the procedure interface.
     D Main            PI
     D  FileInfo                           Const LikeDS(fileinfo_t)
     D  Allow                         5I 0
     D  ErrorMsg                    256A

      /FREE
        Allow = 0;


        // Allow uploads into "assetimg" directory:

        If FileInfo.directory = '/www/profoundui/htdocs/profoundui' +
                                '/userdata/images/assetimg';
           Allow = 1;
        EndIf;

        *InLr = *On;

      /END-FREE
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests