Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread TGrid ctHTML anchor tag download
Sun, Dec 3 2017 6:38 PMPermanent Link

Stephen Kenny

I'm trying to use the 'download' option in an anchor tag in a TGridColumn of type ctHTML.
e.g.

<a href='https://mydomain.com/somefile.pdf' download='NewFilename'>Download</a>

It doesn't work. It just loads the files if the the 'download' wasn't there.

Any ideas how I can achieve this?

thanks

stephen
Mon, Dec 4 2017 5:07 AMPermanent Link

Matthew Jones

Stephen Kenny wrote:

> download='NewFilename'

Which browser? I didn't even know this was possible, but it seems that the browser support is variable, such that Chrome will ignore if it is from a different site than the HTML is from, etc.

Me, I use the content-disposition on the server to tell the browser what to do with downloads.

--

Matthew Jones
Mon, Dec 4 2017 5:38 AMPermanent Link

Stephen Kenny

It's in the HTML 5 standard - so it's only supported on a subset of versions etc etc.


"Matthew Jones" wrote:

Stephen Kenny wrote:

> download='NewFilename'

Which browser? I didn't even know this was possible, but it seems that the browser support is variable, such that Chrome will ignore if it is from a different site than the HTML is from, etc.

Me, I use the content-disposition on the server to tell the browser what to do with downloads.

--

Matthew Jones
Mon, Dec 4 2017 12:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stephen,

<< I'm trying to use the 'download' option in an anchor tag in a TGridColumn of type ctHTML.
e.g.

<a href='https://mydomain.com/somefile.pdf' download='NewFilename'>Download</a> >>

Is the origin (protocol/domain) the same as that from which the application was loaded ?

The restrictions mentioned on MDN are:

1) Same-origin policy
2) Content-Disposition header taking precedence

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

Tim Young
Elevate Software
www.elevatesoft.com
Image