Retrieving opened PDF file(s) from Safari’s temporary files

safari

I opened a bunch of PDF's that I opened in Safari, but didn't download them. Now the website where I was viewing the PDF's is currently under maintenance, but I need those PDF's.

Does safari store those PDF's somewhere in a temporary location where I could locate and open them from?

I've already looked into /users/library/com.apple.safari but I couldn't find any PDF files there.

Best Answer

Preview stores the temporary files (the ones which are directly opened from within Safari without downloading) within sub-directories in /private/var/folders directory.

To find the one you are after, run the following command in Terminal:

sudo find /private/var/folders -type f -name *.pdf -print 2>/dev/null

The path for all the temporarily cached PDF file(s) is displayed. If you see the file you are after, you can simply open it from the displayed path or copy it to a suitable location.