We would like to use the content change timestamp attribute of a file sent us by FTP using 'stat' (C utility) in RPG in order to determine if the file has been processed. Unfortunately for us the filename may not be unique, so one way to check if it has been previously processed is to use a combination of filename and attributes.
We upload the file onto the IFS using the File Upload widget, but this changes the IFS file attributes to the current timestamp. Is there a way to use the File Upload utility and preserve the timestamps of the original file? They are preserved with a drag/drop in Windows so I don't think it's an IBM thing.
Thanks,
Paul
File Upload File Attributes
-
- Profound User
- Posts: 39
- Joined: Mon Aug 29, 2011 10:53 pm
- First Name: Paul
- Last Name: Foster
- Company Name: GRI Group Ltd
- Country: Hong Kong
- Location: Hong Kong
- Contact:
-
- New User
- Posts: 16
- Joined: Mon Jul 02, 2018 7:56 am
- First Name: Kerim
- Last Name: Güney
- Company Name: Task Force IT-Consulting GmbH
- City: Dortmund
- Zip / Postal Code: 44369
- Country: Germany
- Contact:
Re: File Upload File Attributes
Hi Paul,
AFAIK it's not possible with the default upload widget. You might have to send that in as a feature request. I think I have a workaround suggestion that could also be the basis for the implementation of the feature request:
When a file is dragged placed into the upload widget, you might be able to use https://developer.mozilla.org/en-US/doc ... stModified to check the timestamp and put it to an hidden input field. Once the file is in the IFS, your RPG program has to somehow set the file's last modified date to whatever the JS code returned.
Unfortunately, this is one ugly hack. Perhaps you'd be better off using ckecksums/hashes instead of filename + attribute to determine each unique file. See: https://www.mcpressonline.com/programmi ... pg-and-sql and https://www.ibm.com/support/knowledgece ... 3calha.htm
AFAIK it's not possible with the default upload widget. You might have to send that in as a feature request. I think I have a workaround suggestion that could also be the basis for the implementation of the feature request:
When a file is dragged placed into the upload widget, you might be able to use https://developer.mozilla.org/en-US/doc ... stModified to check the timestamp and put it to an hidden input field. Once the file is in the IFS, your RPG program has to somehow set the file's last modified date to whatever the JS code returned.
Unfortunately, this is one ugly hack. Perhaps you'd be better off using ckecksums/hashes instead of filename + attribute to determine each unique file. See: https://www.mcpressonline.com/programmi ... pg-and-sql and https://www.ibm.com/support/knowledgece ... 3calha.htm
-
- New User
- Posts: 1
- Joined: Mon Dec 03, 2018 5:20 am
- First Name: Kevin
- Last Name: Mainer
- Company Name: none
- City: Raleigh
- State / Province: North Carolina
- Country: United States
- Contact:
Re: File Upload File Attributes
Why's this an ugly hack? As long as it works! I've had this upload issue as well.Paul wrote: ↑Wed Nov 14, 2018 1:19 am We would like to solve many problems with lightweight wheelchairs and use the content change timestamp attribute of a file sent us by FTP using 'stat' (C utility) in RPG in order to determine if the file has been processed. Unfortunately for us the filename may not be unique, so one way to check if it has been previously processed is to use a combination of filename and attributes.
We upload the file onto the IFS using the File Upload widget, but this changes the IFS file attributes to the current timestamp. Is there a way to use the File Upload utility and preserve the timestamps of the original file? They are preserved with a drag/drop in Windows so I don't think it's an IBM thing.
Thanks,
Paul
Last edited by Mainer on Tue Dec 05, 2023 8:35 am, edited 2 times in total.
-
- 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 File Attributes
I agree with Kerim.
Having to specify separate field on every screen, populate it with JavaScript, submit it, and then update the file on the IBM i in your own code for every screen you want to do this with... definitely seems like a hack to me.
As Kerim said, you might want to consider making a feature request.
Having to specify separate field on every screen, populate it with JavaScript, submit it, and then update the file on the IBM i in your own code for every screen you want to do this with... definitely seems like a hack to me.
As Kerim said, you might want to consider making a feature request.
Who is online
Users browsing this forum: No registered users and 0 guests