Jump to content

Featured Replies

Posted

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

Solved by Hisashi

Go to solution

There is no built in facility to do this unfortunately. This is intentional as the system was designed

  • Author

Thanks for reply, is there any hack that you know of ??

Not that Im aware of myself personally

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. 

I think he's talking about submit files from URLs, like:

2P7SPOg.png

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:

sVpOpyy.png

This can be done via plugin.

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. 

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.

  • Solution

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.
  • Author

Yes i know, i just want the page to open in a new TAB

Recently Browsing 0

  • No registered users viewing this page.