ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Uploading Data using CPYFRMIMPF

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uploading Data using CPYFRMIMPF

    I have a web program that allows a user to upload a file to the ifs. Then it does a CPYFRMIMPF to put the data into a temporary file for validation and processing.

    What is the best way to attach the user to the records they uploaded?

    Hopefully this makes sense!

    Below is what I'm trying to accomplish!

    1. Give users a csv template that they can upload into IFS.
    2. Once file is loaded into ifs, CPYFRMIMPF into a temporary file so that i can validate data.
    -How can identify what user uploaded the records?
    -Need a way to attach the user to the records they upload.
    3. Move from temporary file into audit file of records that updated successfully.

    Thanks,
    Trent​

  • #2
    You can define a Basic Authentication in your Apache config, based on OS user profiles.
    So the current user is now your user profile, which you can access in sql easily:
    values(current user)

    Hope this may help

    Cheers
    Andy

    Comment

    Working...
    X