Forums

article2pdf : error downloading pdf file (3 posts)

  1. galihboy
    Member
    Posted 9 months ago #

    Hi all,

    I just move my blog to a new web hosting.
    I have same template, same code, same WP version (2.7.1), same plugin.

    Site: http://galih.eu
    E.Q page: http://galih.eu/tentang-aku/

    When i klik: http://galih.eu/tentang-aku/?article2pdf=1

    The URL changed into:

    http://galih.eu/wp-content/plugins/article2pdf/article2pdf_getfile.php?p=dGVudGFuZy1ha3U=&r=31f447&d=L3RtcA==

    And i get error:
    Error 404 - Data atau file tidak ditemukan (Not found)

    Its also happened on single post.

    But, there is some pdf files on cache, and i can download it directly through admin panel.

    Its weird...

    Thanx.

  2. webmatter
    Member
    Posted 8 months ago #

    Hi, I have the same error. Did you find a solution yet?

    I have a custom permalink structure /%postname%/ and include the link per
    <a href="<?php the_permalink(); ?>?article2pdf=1">PDF Version</a>

    Works perfect with one installation, getting an 404 error with the other.

    I too can see that there have been files generated, they do not appear through pdf-link though.

  3. raufaser
    Member
    Posted 8 months ago #

    In the basic configuration options of wordpress you have 2 field: "Site url" and "home" (or something similar to that, my WP is in german so I don't know what's the correct English locale string). Maybe you have not the correct values into that field.

    But I don't know if that really is the problem, cause I can open:
    http://galih.eu/wp-content/plugins/article2pdf/readme.txt

    But I can't open:
    http://galih.eu/wp-content/plugins/article2pdf/article2pdf_getfile.php

    That's really strange, but if the file is physically there I have an idea what the problem due to: The getfile script is seperated from wordpress to avoid conflicts with other plugins. But the script is also seperated from the WordPress permalink redirection, so maybe WP thinks the file isn't there.

    Try the following:
    1. Open the article2pdf_getfile.php with a texteditor (via ftp for example) and add the following source code after first comment part (copy it to line 11)

    $path  = ''; // It should be end with a trailing slash
    /** That's all, stop editing from here **/
    if ( !defined('WP_LOAD_PATH') ) {
    
    	/** classic root path if wp-content and plugins is below wp-config.php */
    	$classic_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/' ;
    
    	if (file_exists( $classic_root . 'wp-load.php') )
    		define( 'WP_LOAD_PATH', $classic_root);
    	else
    		if (file_exists( $path . 'wp-load.php') )
    			define( 'WP_LOAD_PATH', $path);
    		else
    			exit("Could not find wp-load.php");
    }
    
    // let's load WordPress
    require_once( WP_LOAD_PATH . 'wp-load.php');

    Then try again and please report if it solves the problem.

    Marc

Reply

You must log in to post.

About this Topic