How to add a file to an article in archive?

Hi there!
I have imported lots of articles by import\export plugin, but only metadata is added. So how to add pdf files to each article manually (or auto if possible). I have got how to download “additional file” to the server (irredeemably), but it havent appeared in the article page.
I use 2.4.8 ver.
thanks!

Are you constructing the XML from scratch, or is this an export from an existing OJS system?

The OJS native XML import/export plugin should support the galley files as well as the article metadata. See particularly article contains galleys contains file contains externalformat.

1 Like

I exported from another system than remake XML file and inported to OJS

I would definitely recommend recreating the XML with the file references, and re-importing that into a clean install.

You can include a file by embedding it in the XML as a base64 encoded string, or just referencing it via the local file system in a “src” attribute.

1 Like

I followed your advise and tried to import artiles again on a clean ojs. But there is a trouble again!
See screens! I use denwer.



What’s wrong with src attr? I used different variants of src format:

All cases end with the same problem =(

The src parameter should be able to handle a publicly accessible URL, or a relative or absolute local file path.

Note that the system will attempt to copy the file from the src to your files_dir, but it looks like you have already put your files in the files_dir. (Note also that if you are exposing your files_dir directly to the internet, you are losing a bit of control for security and usage tracking within OJS.)

If your site can resolve “http://ojs.ru/files/pdfs/28/1-13.pdf” and has direct download access, I think that should work as the src.

Alternately, if the import is run from the command line (as opposed to the web interface), an absolute or relative path valid for the current working directory should work.

For example, if your PDFs were on the Z: drive under “z:\your-pdf-source”, and your src attributes were “\your-pdf-source\filename.pdf”, or just “filename.pdf”, perhaps something similar to:

> Z:
> cd \your-pdf-source\
> php.exe \home\ojs.ru\www\tools\importExport.php NativeImportExporPlugin yourJournalPath issues

More information is available on the wiki under Importing Articles and Issues.