XML import could not copy pdf to a local file

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
klbr
Posts: 9
Joined: Tue Apr 27, 2010 12:06 am

XML import could not copy pdf to a local file

Postby klbr » Tue Apr 27, 2010 12:31 am

Hello
we are very new with OJS and now experimentating with version 2.3.1-2

We tried to import xml with pdf files using ...importexport.native plugin on
Windows Server 2008 IIS 7.5 and PHP 5.2 with the following error message:

A specified URL "http://www.smw.ch/docs/PdfContent/smw-12977.pdf" could not be copied to a local file.

Galley Part of the XML:

<galley locale="de_DE">
<label>PDF</label>
<file>
<href mime_type="application/pdf" src="http://www.smw.ch/docs/PdfContent/smw-12977.pdf"></href>
</file>
</galley>

is there a simple solution ?

thanks
klaus

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: XML import could not copy pdf to a local file

Postby jmacgreg » Fri Apr 30, 2010 3:27 pm

Hi Klaus,

You can try the following:

1. change the href line in your example from

Code: Select all

<href mime_type="application/pdf" src="http://www.smw.ch/docs/PdfContent/smw-12977.pdf"></href>


to

Code: Select all

<href mime_type="application/pdf" src="http://www.smw.ch/docs/PdfContent/smw-12977.pdf"/>


2. If the files are stored on the same machine, point to them directly, eg.:

Code: Select all

<galley>
    <label>PDF</label>
    <file>
        <href src="/home/klaus/docs/PdfContent/smw-12977.pdf"/>
    </file>
<galley>


3. Of course, also make sure that your import file is well-formed and valid.

See here for more extended information. Let us know if you are still running into issues.

Cheers,
James

klbr
Posts: 9
Joined: Tue Apr 27, 2010 12:06 am

Re: XML import could not copy pdf to a local file

Postby klbr » Mon May 03, 2010 2:34 am

Hello James

thanks for responcing solutions.

Unfortunately no success.

We still have.

Import Error
One or more errors occurred during import. Please check to ensure that the format of the import file correctly matches the specification. Specific details of the import errors are listed below.

•A specified URL "http://www.smw.ch/docs/PdfContent/smw-12977.pdf" could not be copied to a local file.

here is a sample import XML

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE issues PUBLIC "-//PKP//OJS Articles and Issues XML//EN" "http://pkp.sfu.ca/ojs/dtds/2.3/native.dtd">
<issues>
   <issue published="true" current="true" public_id="smw-00021">
      <title locale="de_DE">21/12/2010 (issue 21-01, 2010)</title>
      <volume>2010</volume>
      <number>21</number>
      <year>2010</year>
      <cover locale="de_DE">
         <caption>Titelseite PDF-Import Ausgabe 21</caption>
      </cover>
      <date_published>2010-04-21</date_published>
      <access_date>2010-04-21</access_date>
      <section>
         <title locale="de_DE">Special article</title>
         <abbrev locale="de_DE">SART</abbrev>
         <article>
            <title locale="de_DE">PDF Import 21</title>
            <abstract locale="de_DE">Diabetes mellitusc patients....ass graft surgery versus percutaneous coronary intervention) in diabetic patients with coronary artery disease depends on clinical and anatomic considerations.</abstract>
            <author primary_contact="true">
               <firstname>Hans</firstname>
               <lastname>Hintermuster</lastname>
               <affiliation>Schwabe AG Informatik</affiliation>
               <country>CH</country>
               <email>k.brandmeier@schwabe.ch</email>
            </author>
            <pages>155-200</pages>
            <date_published>2010-04-21</date_published>
            <galley locale="de_DE">
               <label>PDF</label>
               <file>
                  <href mime_type="application/pdf" src="http://www.smw.ch/docs/PdfContent/smw-12977.pdf"/>
               </file>
            </galley>
         </article>
      </section>
   </issue>
</issues>



Remark: We have no errors when importing the same xml with command-line import and local pdf file reverences...

salutation
klaus

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: XML import could not copy pdf to a local file

Postby jmacgreg » Thu May 06, 2010 10:17 am

Hi Klaus,

I can't replicate this problem on my own local server, using OJS 2.3.1-2 -- the import process seems to be working fine via the web. Can you check your server's error log to see if anything is being reported there? I've also asked a developer to take a look at this thread.

Cheers,
James

mgscano
Posts: 72
Joined: Tue Jan 27, 2009 3:22 am
Location: Brescia, Italy
Contact:

Re: XML import could not copy pdf to a local file

Postby mgscano » Fri May 07, 2010 3:15 am

Klaus, this sounds like an old well known story ...

Add these two lines at the end of your server's php.ini file

Code: Select all

allow_url_fopen = On
allow_url_include = On


The guys in PKP will always tell you that it is not necessary, and for them it is absolutely true because they have the root password for all their servers :wink: , but most of the shared server hosting services installations do not work if you don't make that change.

it's worth to give it a try.

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: XML import could not copy pdf to a local file

Postby asmecher » Fri May 07, 2010 8:30 am

Hi all,

This might be worth a try -- but FYI, the allow_url_include setting is never required by OJS. It's a common security risk for remote include security flaws so unless you need it for some other reason it's best left disabled.

Regards,
Alec Smecher
Public Knowledge Project Team

klbr
Posts: 9
Joined: Tue Apr 27, 2010 12:06 am

Re: XML import could not copy pdf to a local file

Postby klbr » Thu May 20, 2010 6:42 am

hi all

the solution was to disable the ";open_basedir" entry in php.ini

maybe windows server 2008 was not in the condition to handle the restrictions.

nevertheless thanks klaus

TomCobbaert
Posts: 6
Joined: Fri Oct 08, 2010 3:32 am

Re: XML import could not copy pdf to a local file

Postby TomCobbaert » Sat Oct 16, 2010 2:23 am

We were having the same problem. And in addition to the solution Klaus found, the hint mgscano gave was the one that solved it for us.
We are using shared hosting for our journal-website, thus not having root access. Our host still allows us to make some changes to the php.ini file. Not the ;open_basedir entry Klaus disabled did the trick, but enabling allow_url_fopen and allow_url_include.


Return to “OJS Editorial Support and Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest