All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: SOLVED: Using File Name and Remote File will not work  (Read 950 times)

0 Members and 1 Guest are viewing this topic.

Offline Blaubaer

  • Newbie
  • *
  • Posts: 4
    • View Profile
SOLVED: Using File Name and Remote File will not work
« on: 08 November 2009, 15:11 »
Hello,

I am having a problem with remote files and the download url.

Wordpress Version: 2.8.5
Theme Name: Default Theme
Blog URL: localhost (XAMPP test environment)
Problem Plugin: WP-DownloadManager 1.5
PHP Version: 5.3.0
MySQL Version: 5.1.37
Possible Conflicting Plugins: no other plugins installed
Permalink Structure: http://localhost/wordpress/2009/11/sample-post/

I want to add a remote file to my download page, but this won't work while options are set to "Download Nice Permalink: Yes" and "Use File Name Or File ID In Download URL?: File Name"

The generated link on the download page is: http://localhost/wordpress/download/ttp://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.2/deu/AdbeRdr920_de_DE.exe and will cause an "Invalid File ID or File Name" Error.

The file url is for testing purposes, the problem occurs on every remote file. http://localhost/wordpress/download/ is the beginning an then the "h" form the original file url is missing, followed by the rest of the url.
Because of my limited english knowlegdes, see screenshot attached, maybe you will better know what the problem is...

Changing the options to use File ID instead will work, but I really want to use the file name.

Any idea?

Blaubaer
« Last Edit: 08 November 2009, 15:52 by Blaubaer »

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Using File Name and Remote File will not work
« Reply #1 on: 08 November 2009, 15:42 »
Thanks for the bug report. I will fix it.

In the mean time,

Open up wp-downloadmanager.php:

Find on line 198:
Code: [Select]
$file = $wpdb->get_row("SELECT file_id, file, file_permission FROM $wpdb->downloads WHERE file = \"/$dl_name\" AND file_permission != -2");Replace:
Code: [Select]
if(!is_remote_file($dl_name)) {
$dl_name = '/'.$dl_name;
}
 $file = $wpdb->get_row("SELECT file_id, file, file_permission FROM $wpdb->downloads WHERE file = \"$dl_name\" AND file_permission != -2");

Find on line 386:
Code: [Select]
$file_name = substr(stripslashes($file_name), 1);Replace:
Code: [Select]
$file_name = stripslashes($file_name);
if(!is_remote_file($file_name)) {
$file_name = substr($file_name, 1);
}
It should work

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Blaubaer

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Using File Name and Remote File will not work
« Reply #2 on: 08 November 2009, 15:52 »
Damn what fast, thanks a lot  ;D

Is there any way to change the url http://localhost/wordpress/download/http://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.2/deu/AdbeRdr920_de_DE.exe to http://localhost/wordpress/download/AdbeRdr920_de_DE.exe or use the file name instead?

I don't want the visitors showing the original source

Blaubaer


Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: SOLVED: Using File Name and Remote File will not work
« Reply #3 on: 08 November 2009, 15:54 »
Sorry that is not possible that was my initial plan but after thinking of it, it is not possible.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Blaubaer

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SOLVED: Using File Name and Remote File will not work
« Reply #4 on: 08 November 2009, 15:55 »
O.K. and what about using the given file name?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: SOLVED: Using File Name and Remote File will not work
« Reply #5 on: 08 November 2009, 16:04 »
No. This is the only way out at the moment. If I happen to think of something, it will be in the next update.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Blaubaer

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SOLVED: Using File Name and Remote File will not work
« Reply #6 on: 08 November 2009, 16:12 »
Great, thank you for your fast support!

Greetings from Germany, Blaubaer