Page 1 of 1

File Upload File Attributes

Posted: Wed Nov 14, 2018 1:19 am
by Paul
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

Re: File Upload File Attributes

Posted: Tue Dec 04, 2018 3:44 am
by TaskForce_Kerim
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

Re: File Upload File Attributes

Posted: Tue Dec 04, 2018 10:02 am
by Mainer
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
Why's this an ugly hack? As long as it works! I've had this upload issue as well.

Re: File Upload File Attributes

Posted: Thu Dec 06, 2018 3:44 pm
by Scott Klement
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.