have been asked to add a feature to our cms driven sites to automatically open any attachments (Ie pdsf, xls, doc) that may be on the page, personally I don't like this idea as it seems to work against the web and would give a negative user experience.

Can anyone share their opinions/thoughts?

  • 1
    What do you mean 'automatically opening'? I assume you're referring to when you click on a particular link to a PDF/DOC it automatically opens? The way the question is written it kind of reads like you want everything to open when you first land on a page. – JonW Aug 6 '13 at 8:15
  • I believe you mean that a user triggered event to open a document which is in ie PDF form will automatically open the document in a new tab in the browser? This is an established solution IMO and enables the user to view the document without downloading it, but can still choose to download it if they desire to. – AndroidHustle Aug 6 '13 at 8:33
  • JonW that is exactly what i meant, apologies for the ambiguity – DavidB Aug 6 '13 at 8:43
  • AndroidHustle - Thanks for the reply, you cannot view something without first downloading it. I think this is a bad idea, if there are ten pdf links on the page then should it open all of them? – DavidB Aug 6 '13 at 8:45
  • @DavidB In a technical aspect NO, you can't view a document without having it downloaded/streamed to the device. However, the UX point of view doesn't take the technical aspects into account but rather focus on how a flow/feature is perceived by the user. A document opened automatically in the browser will not be perceived as being downloaded by the user, in the same way that they don't perceive a website they visit as being "downloaded" (even though in technical terms it is). However, if the scenario you describe would mean that multiple PDF's opens automatically then I agree, it's not good. – AndroidHustle Aug 6 '13 at 9:18

This is very bad practice to auto-open any attachenemts on page load.

  • It takes the control off the user
  • It breaks the flow, when there are a bunch of opened documents appear
  • Some attachement will be opened in a tab while others are downloaded, it totally mess
  • It loads browser and system resourses, up to blocking the system
  • New tabs could be blocked by browser's page-blocking plugins
  • There are risk of security when one of attachement is virused etc.

You could emulate such behavior by searching something with Google and then executing in console (it will open all the results in a new tabs):

var lnks = document.getElementsByClassName('r'); for(i in lnks) {lnks[i].firstChild.setAttribute('target','_blank');lnks[i].firstChild.click();};

  • I don't think you can have files automatically download to a client on load, the browser will prohibit it. The user has to accept the download I think. – AndroidHustle Aug 6 '13 at 9:59
  • @AndroidHustle I've played with my script for XLS files in Google search results (request cms filetype:xls), Chrome downloaded all of them without my acceptance. – Alexey Kolchenko Aug 6 '13 at 10:04
  • @AlexeyKolchenko Hmmm, interesting, didn't know that. – AndroidHustle Aug 6 '13 at 10:32

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.