1 | <?php |
---|
2 | // +-------------------------------------------------+ |
---|
3 | // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) |
---|
4 | // +-------------------------------------------------+ |
---|
5 | // $Id: folow_import.php,v 1.12 2015-06-19 07:35:06 vtouchard Exp $ |
---|
6 | |
---|
7 | //Transmission ensuite du fichier converti |
---|
8 | $base_path = "../.."; |
---|
9 | $base_auth = "ADMINISTRATION_AUTH|CATALOGAGE_AUTH"; |
---|
10 | $base_title = "\$msg[ie_import_running]"; |
---|
11 | $base_noheader=1; |
---|
12 | $base_nobody=1; |
---|
13 | $base_nosession=0; |
---|
14 | require ($base_path."/includes/init.inc.php"); |
---|
15 | |
---|
16 | //Supression du fichier transmis |
---|
17 | @unlink("$base_path/temp/$file_in"); |
---|
18 | |
---|
19 | //Fichier converti |
---|
20 | $f = explode(".", $file_in); |
---|
21 | if (count($f) > 1) { |
---|
22 | unset($f[count($f) - 1]); |
---|
23 | } |
---|
24 | $file_out = implode(".", $f).".".$suffix."~"; |
---|
25 | |
---|
26 | //Téléchargement |
---|
27 | if (!file_exists("$base_path/temp/$file_out")) { |
---|
28 | header("Content-type: text/html; charset=".$charset); |
---|
29 | print $std_header; |
---|
30 | print "<body>"; |
---|
31 | error_message_history($msg['admin_convert_erreur_destination'],$msg['admin_convert_fichier_existe'],0); |
---|
32 | exit; |
---|
33 | } |
---|
34 | |
---|
35 | if ($deliver==3) { |
---|
36 | if (!$mimetype) { |
---|
37 | header("Content-Type: application/download"); |
---|
38 | } else { |
---|
39 | header("Content-Type: ".$mimetype); |
---|
40 | } |
---|
41 | header("Content-Length: ".filesize("$base_path/temp/$file_out")); |
---|
42 | header("Content-Disposition: attachment; filename=".implode(".", $f).".$suffix"); |
---|
43 | @readfile("$base_path/temp/$file_out"); |
---|
44 | @unlink("$base_path/temp/$file_out"); |
---|
45 | } else { |
---|
46 | //@copy("$base_path/temp/$file_out","$base_path/admin/import/unimarc.fic"); |
---|
47 | @copy("$base_path/temp/$file_out","$base_path/admin/import/unimarc".(defined("LOCATION")?"_".constant("LOCATION"):"").".fic"); |
---|
48 | |
---|
49 | @unlink("$base_path/temp/$file_out"); |
---|
50 | if ($deliver==1) $sub="import"; else $sub="import_expl"; |
---|
51 | echo "<script>document.location=\"$base_path/admin/import/iimport_expl.php?categ=import&sub=$sub&func_import=".$func_import."&action=preload\";</script>"; |
---|
52 | } |
---|
53 | ?> |
---|