I have a simple command line tool that fetches preview images from a remote location and uploads to Filestack every time it runs, even if the images had been uploaded in previous runs. Is there a standard way I can check if a file already exists in Filestack before attempting an upload?
Options I'm considering:
One option would be to make HTTP HEAD request to the potential Filestack file URL, but AFAIK that's only possible if I have the Filestack image handle/key from the previous run.
The other option would be to :
I just want to know if there's a better or Filestack(standard) way of doing this other than the options I'm considering.
Did a bit of research and it seems with Filestack there's no way to check if a file was uploaded unless the file handle/key is known as I stated earlier. So I settled for the second approach which is to store a key/value map of resourceId and file URL locally, then use object serialization and deserialization technique to preserve state and it works pretty well. here are the steps