File-info:full-pathname - unique identifier

Posted by goo on 01-Feb-2020 21:29

12

I need to have a unique identifier to a file on disk, without posibility to store anything in the database. It needs to be in a format that can be transported using webhandler. 

if the full path is something like this:

\\myserver\myshare\332\2020\sometekst233-22332-2112.pdf

is it possible to use a encode hash or base64 to send to webhandler, and then do a decode back to normal? 

The customer will send the encoding back to me and I will send the correct pdf file from disk...

All Replies

Posted by goo on 01-Feb-2020 21:36

It seems like base64 gives me this:

"XFxteXNlcnZlclxteXNoYXJlXDMzMlwyMDIwXHNvbWV0ZWtzdDIzMy0yMjMzMi0yMTEyLnBkZg=="

so that would probably be an ok format...

Posted by Peter Judge on 03-Feb-2020 14:56

It's easy enough to calculate a digest (look at the MESSAGE-DIGEST function) but finding the file from that hash will be harder, since digests are one-way (ie you will need to read all the files in the directory until you find the one with a matching digest).
 
You could mitigate this by using a TT to store the digests and their file names, but
- you have to do it in each session
- the cache of digests will get stale, probably quite quickly: new files, deleted files, renamed files will all affect that cache.
 
You will also need to think about which directory to look in … it looks like there's some structore already "332" and "2020" .
 
 
 

Posted by goo on 03-Feb-2020 17:18

By using bash64 in fullname seems to work swell, an the chance to get the same base64 resolution for different full names are probably small,I hope :-) but by adding the digest to the base64 string and check it when getting the file would be even better...

Sendt fra min iPad

3. feb. 2020 kl. 15:57 skrev Peter Judge <bounce-pjudge@community.progress.com>:


<ProgressEmailLogo-png_2D00_150x42x2-png>
Update from Progress Community
<4TW97ZQFKRYJ-jpg_2D00_70x70x2-jpg>
Peter Judge

It's easy enough to calculate a digest (look at the MESSAGE-DIGEST function) but finding the file from that hash will be harder, since digests are one-way (ie you will need to read all the files in the directory until you find the one with a matching digest).
 
You could mitigate this by using a TT to store the digests and their file names, but
- you have to do it in each session
- the cache of digests will get stale, probably quite quickly: new files, deleted files, renamed files will all affect that cache.
 
You will also need to think about which directory to look in … it looks like there's some structore already "332" and "2020" .
 
 
 

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

This thread is closed