dogbone Posted October 30, 2022 Posted October 30, 2022 I store my files with an external file host. And when i "Add files by URL" the page opens i the same window. I want it to open in a new window. I've gone through everything in the control panel but can't find anything that can do this. Anybody who can help me with this ???? Eivind
Marc Posted October 31, 2022 Posted October 31, 2022 There is no built in facility to do this unfortunately. This is intentional as the system was designed
dogbone Posted October 31, 2022 Author Posted October 31, 2022 Thanks for reply, is there any hack that you know of ??
opentype Posted October 31, 2022 Posted October 31, 2022 Are you just pointing to files on that external host or is it like a download page that comes up? Normally, there should be no need to worry about the windows with direct file links. If everything is set up properly, the external file would just be downloaded and the user would stay on your website.
Adriano Faria Posted October 31, 2022 Posted October 31, 2022 I think he's talking about submit files from URLs, like: In that case, when you click to download, you're redirected to that site. /* Download */ if ( $data['record_type'] === 'link' ) { \IPS\Output::i()->redirect( $data['record_location'] ); } else { $file = \IPS\File::get( 'downloads_Files', $data['record_location'], $data['record_size'] ); $file->originalFilename = $data['record_realname'] ?: $file->originalFilename; $this->_download( $file ); } Location: This can be done via plugin.
opentype Posted October 31, 2022 Posted October 31, 2022 2 minutes ago, Adriano Faria said: think he's talking about submit files from URLs, Yes, that’s what I mean as well. If you add a file URL (not a page), it should directly download that file. That’s why I am asking what type of URL we are talking about. Adriano Faria 1
Adriano Faria Posted October 31, 2022 Posted October 31, 2022 2 minutes ago, opentype said: If you add a file URL (not a page), it should directly download that file Just tested and that's it. Tried with a .zip and it downloads; it doesn't redirect.
dogbone Posted November 1, 2022 Author Posted November 1, 2022 I just add a file URL and it taking me away from my site. Take a look here and try the link: https://esimensen.tech/cms/index.php?/files/file/4-avast-security-for-mac/
Solution Hisashi Posted November 1, 2022 Solution Posted November 1, 2022 Themes > Edit HTML/CSS (Enter advanced mode if you are on simple) > Templates > downloads > view > downloadButton Add a "target="_blank"" on line 11, the code will look like this: {{else}} <a target="_blank" href='{{if settings.idm_antileech AND !$file->requiresDownloadConfirmation()}}{$file->url('download')->csrf()}{{else}}{$file->url('download')}{{endif}}' class='ipsButton ipsButton_fullWidth ipsButton_large ipsButton_important' {{if $file->requiresDownloadConfirmation()}}data-ipsDialog{{endif}} data-datalayer-postfetch >{lang="download_now"}</a> {{endif}} </li> Some observations... You will no longer receive auto-update in this edited template. I only recommend it if your downloads are based on external links, I don't know how that might behave for uploaded files. Afrodude 1
Adriano Faria Posted November 1, 2022 Posted November 1, 2022 4 hours ago, dogbone said: I just add a file URL and it taking me away from my site. Take a look here and try the link: https://esimensen.tech/cms/index.php?/files/file/4-avast-security-for-mac/ This is a link to page, not a file itself (.zip, .tar, etc), that’s why you’re redirected.
dogbone Posted November 1, 2022 Author Posted November 1, 2022 Yes i know, i just want the page to open in a new TAB
Recommended Posts