22define(
'NOTOKENRENEWAL', 1);
25require
'../../../../main.inc.php';
30<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
32 * FCKeditor - The text editor
for Internet - http:
33 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
37 * Licensed under the terms of any of the following licenses at your
40 * - GNU General Public License Version 2 or later (the
"GPL")
43 * - GNU Lesser General Public License Version 2.1 or later (the
"LGPL")
46 * - Mozilla Public License Version 1.1 or later (the
"MPL")
51 * Page used to upload
new files in the current folder.
55 <title>File Upload</title>
56 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
58print
'<!-- Includes CSS for Dolibarr theme -->'.
"\n";
62if (!empty($conf->modules_parts[
'theme'])) {
63 foreach ($conf->modules_parts[
'theme'] as $reldir) {
66 $themesubdir = $reldir;
73print
'<link rel="stylesheet" type="text/css" href="'.$themepath.
'">'.
"\n";
75 <link href=
"browser.css" type=
"text/css" rel=
"stylesheet" >
76 <script
type=
"text/javascript" src=
"js/common.js"></script>
77 <script
type=
"text/javascript">
79function SetCurrentFolder( resourceType, folderPath )
81 var sUrl = oConnector.ConnectorUrl +
'Command=FileUpload' ;
82 sUrl +=
'&Type=' + resourceType ;
83 sUrl +=
'&CurrentFolder=' + encodeURIComponent( folderPath );
85 document.getElementById(
'frmUpload').action = sUrl ;
90 console.log(
"Click on OnSubmit");
91 if ( document.getElementById(
'NewFile').value.length == 0 )
93 alert(
'Please select a file from your computer' );
98 document.getElementById(
'eUploadMessage').innerHTML =
'Upload a new file in this folder (Upload in progress, please wait...)' ;
99 document.getElementById(
'btnUpload').disabled = true ;
104function OnUploadCompleted( errorNumber, data )
106 console.log(
"errorNumber = "+errorNumber);
109 window.parent.frames[
'frmUploadWorker'].location =
'javascript:void(0)' ;
113 document.getElementById(
'NewFile').outerHTML =
'<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
115 document.getElementById(
'frmUpload').reset();
118 document.getElementById(
'eUploadMessage').innerHTML =
'Upload a new file in this folder' ;
119 document.getElementById(
'btnUpload').disabled = false ;
121 switch ( errorNumber )
124 window.parent.frames[
'frmResourcesList'].Refresh();
130 window.parent.frames[
'frmResourcesList'].Refresh();
131 alert(
'A file with the same name is already available. The uploaded file has been renamed to "' + data +
'"' );
134 alert(
'Invalid file (Bad extension)' );
137 alert(
'Error on file upload. Error number: ' + errorNumber );
142window.onload =
function()
144 window.top.IsLoadedUpload = true ;
149 <form
id=
"frmUpload" action=
"" target=
"frmUploadWorker" method=
"post" enctype=
"multipart/form-data" onsubmit=
"return OnSubmit();">
150 <input
type=
"hidden" name=
"token" value=
"<?php echo newToken(); ?>" />
151 <table
class=
"fullHeight" cellspacing=
"0" cellpadding=
"0" width=
"100%" border=
"0">
153 <td
class=
"nowrap valignmiddle">
154 <table width=
"100%" class=
"inline-block valignmiddle">
156 <td><input
id=
"NewFile" name=
"NewFile" type=
"file"></td>
157 <td
class=
"nowrap"> <input
id=
"btnUpload" type=
"submit" value=
"Upload" class=
"flat button"></td>
160 <!-- Section
for upload result message -->
161 <span
id=
"eUploadMessage"></span><br>
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.