21

When viewing images on google images, one might accidentally click on "save image as", or "view image" (which somehow sometimes prompts a download as well). This then opens a window asking if you want to download said file. However, if you cancel before anything gets saved, is this still seen as a download from the "server" side? Since i am not that well versed in this topic, my use of "server" just covers whatever entity might record/save said activity.

  • 4
    Registered as such by whom? Many log analysis software (ie awstats, goaccess) considers a download any file with a particular suffixes (.zip, .pdf...). The list of extensions is usually configurable. Other software may use different approaches. – jjmontes Jan 14 '19 at 15:06
52

Seen from the server side, there is absolutely no technical difference between "transferring for viewing in a browser window" and "downloading for storage".

Maybe a server will provide a (smaller) preview and the (larger) real image for download, and can distinguish which one has been accessed. But it can register (and log) only the access to these files, the IP address the request came from, a generic "id string" of the browser software - not the intent of a client.

But file access does not always result from human interaction with a client computer. On the one hand, browsers store images and other website data on your system even if you don't even use "save image as...". On the other hand, many browsers even "follow links" (that is: download things!) in advance, to speed up navigation. The browser cache even might get into your local backup that way, even if you never willfully accessed these files!

Finally, using "save as" and cancelling (not selecting a destination filename) may or may not initiate a download, depending on the implementation of the browser you are using.

| improve this answer | |
  • 12
    Heck: "save as" may or may not initiate a download, regardless of cancelling - if the browser already has the image, why request it from the server again ("no cache" hints and such notwithstanding). – minnmass Jan 14 '19 at 3:37
  • 6
    Actually, there can be a difference, in terms of the Content-Disposition HTTP header: inline indicates a view in the browser, attachment a download. – Uwe Keim Jan 14 '19 at 6:48
  • 13
    @UweKeim it's actually a hint from the server. Normally browser would follow it but the server has no way to judge if the client is actually a browser nor if it's going to respect this header. curl https://www.google.com/ -H 'User-Agent: I am really a web browser, trust me' >> /dev/null ;) – ElmoVanKielmo Jan 14 '19 at 7:31
  • 1
    ... and to show that it's more than theoretical, consider PDF's. Historically those have been treated by browsers as downloads, but modern browsers can directly display them. – MSalters Jan 14 '19 at 9:57
  • 1
    The browser will initiate a download unless that URL, etc. are already in the browser's cache. Otherwise, the browser has no way to tell what the file name might be, the type of document it is, or even if there is any file contents to save. The browser will issue some kind of request to the server, and the server will "count" that however it wants. – Christopher Schultz Jan 14 '19 at 18:01
7

Since i am not that well versed in this topic, my use of "server" just covers whatever entity might record/watch/save said activity.

While the HTTP server doesn't see the canceled download, there may be Javascript code on the page that monitors such events.

Javascript has event handlers that can be used to detect a right click on the image, and it is quite likely that one could monitor other mouse movements to guess at what choice you make from the popup menu. After that, the script can easily send the information to server immediately, or store it in local browser storage and send it later.

In the specific case of Google Image search, the Javascript on that page does have multiple handlers listening to the mouse events. However the code is obfuscated so it is not easy to tell what kind of monitoring it does.

| improve this answer | |
  • 1
    "Save Target As" will usually contact the server to get the file name, type, size. Possibly with a HEAD HTTP request rather than a GET. – Ben Voigt Jan 14 '19 at 19:53
  • @BenVoigt there is a big difference between "Save Target As" and "save image as". One is for links, the other for images which are already visible and therefore have been downloaded before. – Josef says Reinstate Monica Jan 15 '19 at 11:52
  • @Josef: True, but I see nothing in the question that indicates OP wants to limit himself to content already in cache. In fact I see a strong suggestion to the contrary, in the phrase 'cancel before anything gets saved'. – Ben Voigt Jan 15 '19 at 14:20
6

This is server dependent.

The server would be able to register when the download is started (think about it, it must know because it suggests a name).

The server could also keep track of how many bytes were transferred and if/when the connection closed, which can show if the diwnload completed.

There are also other possibilities like resumed dowloads and multithreaded downloads - but again, the server could know and record all this.

Note that in the particular case of right clicking and downloading an image it is possible that the download would not register as a download at all due to client side caching.

| improve this answer | |
  • The server does not suggest a name. No additional network requests were made when I right click on your avatar and selected "save image as" – DavidPostill Jan 13 '19 at 12:17
  • 9
    @DavidPostill Depends on how the download is initiated. If you follow a link or redirect to a resource, and the server responds with Content-Disposition: attachment; filename="…" so that the browser shows the download prompt, then even when cancelling the download the server will know about the request - and probably can even distinguish that the download was aborted. – Bergi Jan 13 '19 at 13:53
4

If ... you cancel before anything gets saved, does the "server" notice/record this as a download?

A remote server should not notice any download activity as no download has been started.

However, a remote server knows that you have already downloaded the image in order to display it in your browser ... and a copy will be in your browser cache ...

Any "entity" monitoring your local machine directly could record something regarding that activity.

| improve this answer | |
  • 2
    "Save as..." will make a request, won't it? Browser has to know what name to suggest, for one. The url migh be just plain /download but the Content-Disposition header will contain the actual file name. – data Jan 13 '19 at 12:11
  • 1
    @data No. The name is in the html of the downloaded page. – DavidPostill Jan 13 '19 at 12:13
  • 1
    Do note that some browsers such as Chrome eagerly pre-download and cache URLs that appear in the webpage you're visiting. – Tobia Tesan Jan 13 '19 at 13:33
  • 3
    @DavidPostill You are mistaken. The name can be overridden by the Content-Disposition header (already mentioned to you a couple of times), meaning a request must be made first. In addition, browsers can and do begin the payload download before you've chosen a destination directory. – Lightness Races in Orbit Jan 13 '19 at 22:33
  • 6
    Every web browser I know of will start the download as soon as you click the link, and has done so for at least the past twenty years. They won't wait for you to pick a filename -- they'll save to a temporary file (or memory) and re-name it once you hit "OK". – Mark Jan 14 '19 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.