|
Копирование файла
|
|||
---|---|---|---|
#18+
Через fileUpload нужно копировать файл в папку на сервере, есть класс со свойством стринг типа, туда нужно записать путь к этому файлу и сохранить в этом же классе ... |
|||
:
Нравится:
Не нравится:
|
|||
15.01.2013, 13:29 |
|
Копирование файла
|
|||
---|---|---|---|
#18+
Вот вариант чтения файла в csp...<!-- Copyright (c) 2001 InterSystems Inc. ALL RIGHTS RESERVED. --> <csp:class description="Demo of how to upload a file from the browser."> <html> <head> </head> <body bgcolor="#CCCCFF"> <!-- display standard sample template using a custom tag --> <isc:SAMPLE title="Upload a file Sample"> This sample uses an '<input type=file>' element in a form to upload a file from the web browser to CSP. Pick a file and hit the submit button to try it. </isc:SAMPLE> <!-- HTML Form to submit the file. You must specify the enctype="multipart/form-data" --> <!-- for this to work --> <form action="upload.csp" enctype="multipart/form-data" method="post"> Enter a file to upload here: <input name=FileStream size=30 type=file> <p> <ul><input type="submit" value="Upload file"></ul> <p> </form> <!-- As form is submitted to this page look to see if we have the stream in the %request object --> <csp:if condition='($data(%request.MimeData("FileStream",1)))'> <hr><br> Submitted filename: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).FileName))#</b><br> Size of file: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).Size))#</b><br> Mime Section: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).MimeSection))#</b><br> Type of stream: <b>#(..EscapeHTML($classname(%request.MimeData("FileStream",1))))#</b><br> Content Type: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).ContentType))#</b><br> <br> First 200 characters of stream:<br> <ul> <script language="Cache" runat="server"> New bytes Set bytes=%request.MimeData("FileStream",1).Read(200) Set bytes=##class(%CSP.Utils).DecodeData(bytes) Write bytes,! </script> </ul> </csp:if> </body> </html> ... |
|||
:
Нравится:
Не нравится:
|
|||
15.01.2013, 13:54 |
|
Копирование файла
|
|||
---|---|---|---|
#18+
Sabyrov.Talgat , Код, предложенный krvsa , можете найти на странице upload.csp ( CSP Samples ) Сами файлы *.csp лежат в %CACHE_HOME%\CSP\samples\ ... |
|||
:
Нравится:
Не нравится:
|
|||
15.01.2013, 20:07 |
|
|
start [/forum/topic.php?fid=39&fpage=30&tid=1557261]: |
0ms |
get settings: |
7ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
27ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
41ms |
get tp. blocked users: |
2ms |
others: | 247ms |
total: | 354ms |
0 / 0 |