Open Journal Systems  3.3.0
multipart/make.php
1 <?php
2 
3  // Load the PHP library
4  include_once('../../../../packager_atom_multipart.php');
5 
6  // Store the values
7  session_start();
8  $_SESSION['durl'] = $_POST['durl'];
9 
10  // Set the location of this site on file
11  include('../../config.php');
12 
13  // Construct the package
14  $test_rootin = $_SESSION['location'];
15  $test_dirin = 'files';
16  $test_rootout = $_SESSION['location'] . '/files';
17  $test_fileout = mt_rand() . '.multipart';
18 
19  // Create the test package
20  $test_packager = new PackagerAtomMultipart($test_rootin, $test_dirin, $test_rootout, $test_fileout);
21  $test_packager->setTitle($_POST['title']);
22  $test_packager->setIdentifier($_POST['identifier']);
23  $test_packager->addEntryAuthor($_POST['author']);
24  $test_packager->setSummary($_POST['abstract']);
25  $test_packager->addMetadata("abstract", $_POST['abstract']);
26  $test_packager->addMetadata("available", $_POST['date']);
27  $test_packager->addMetadata("creator", $_POST['author']);
28  $test_packager->addMetadata("identifier", $_POST['identifier']);
29  $test_packager->addMetadata("title", $_POST['title']);
30 
31  $filename = $test_rootin . $test_dirin . '/' . basename($_FILES['file']['name']);
32  move_uploaded_file($_FILES['file']['tmp_name'], $filename);
33  $test_packager->addFile(basename($_FILES['file']['name']));
34 
35  $test_packager->create();
36 
37  $_SESSION['filename'] = $test_rootout . '/' . $test_fileout;
38 
39 
40  // Is it in progress?
41  if(isset($_POST['inprogress'])) {
42  $_SESSION['inprogress'] = "true";
43  } else {
44  $_SESSION['inprogress'] = "false";
45  }
46 
47  header('Location: ../../post/multipart/');
48 
49 ?>
PackagerAtomMultipart
Definition: packager_atom_multipart.php:5