/source/Plug-in/fck/editor/filemanager/browser/default/frmupload.html

http://prosporous.googlecode.com/ · HTML · 114 lines · 82 code · 10 blank · 22 comment · 0 complexity · c7fcd39c980c7c8aefe9390c6bdd866a MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!--
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2007 Frederico Caldeira Knabben
  5. *
  6. * == BEGIN LICENSE ==
  7. *
  8. * Licensed under the terms of any of the following licenses at your
  9. * choice:
  10. *
  11. * - GNU General Public License Version 2 or later (the "GPL")
  12. * http://www.gnu.org/licenses/gpl.html
  13. *
  14. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15. * http://www.gnu.org/licenses/lgpl.html
  16. *
  17. * - Mozilla Public License Version 1.1 or later (the "MPL")
  18. * http://www.mozilla.org/MPL/MPL-1.1.html
  19. *
  20. * == END LICENSE ==
  21. *
  22. * Page used to upload new files in the current folder.
  23. -->
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <title>File Upload</title>
  27. <link href="browser.css" type="text/css" rel="stylesheet" />
  28. <script type="text/javascript" src="js/common.js"></script>
  29. <script type="text/javascript">
  30. function SetCurrentFolder( resourceType, folderPath )
  31. {
  32. var sUrl = oConnector.ConnectorUrl + 'Command=FileUpload' ;
  33. sUrl += '&Type=' + resourceType ;
  34. sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;
  35. document.getElementById('frmUpload').action = sUrl ;
  36. }
  37. function OnSubmit()
  38. {
  39. if ( document.getElementById('NewFile').value.length == 0 )
  40. {
  41. alert( 'Please select a file from your computer' ) ;
  42. return false ;
  43. }
  44. // Set the interface elements.
  45. document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder (Upload in progress, please wait...)' ;
  46. document.getElementById('btnUpload').disabled = true ;
  47. return true ;
  48. }
  49. function OnUploadCompleted( errorNumber, data )
  50. {
  51. // Reset the Upload Worker Frame.
  52. window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
  53. // Reset the upload form (On IE we must do a little trick to avoid problems).
  54. if ( document.all )
  55. document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
  56. else
  57. document.getElementById('frmUpload').reset() ;
  58. // Reset the interface elements.
  59. document.getElementById('eUploadMessage').innerHTML = 'Upload a new file in this folder' ;
  60. document.getElementById('btnUpload').disabled = false ;
  61. switch ( errorNumber )
  62. {
  63. case 0 :
  64. window.parent.frames['frmResourcesList'].Refresh() ;
  65. break ;
  66. case 1 : // Custom error.
  67. alert( data ) ;
  68. break ;
  69. case 201 :
  70. window.parent.frames['frmResourcesList'].Refresh() ;
  71. alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' ) ;
  72. break ;
  73. case 202 :
  74. alert( 'Invalid file' ) ;
  75. break ;
  76. default :
  77. alert( 'Error on file upload. Error number: ' + errorNumber ) ;
  78. break ;
  79. }
  80. }
  81. window.onload = function()
  82. {
  83. window.top.IsLoadedUpload = true ;
  84. }
  85. </script>
  86. </head>
  87. <body bottommargin="0" topmargin="0">
  88. <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
  89. <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
  90. <tr>
  91. <td nowrap="nowrap">
  92. <span id="eUploadMessage">Upload a new file in this folder</span><br>
  93. <table cellspacing="0" cellpadding="0" width="100%" border="0">
  94. <tr>
  95. <td width="100%"><input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file"></td>
  96. <td nowrap="nowrap">&nbsp;<input id="btnUpload" type="submit" value="Upload"></td>
  97. </tr>
  98. </table>
  99. </td>
  100. </tr>
  101. </table>
  102. </form>
  103. </body>
  104. </html>