請教,pb11可以實作BS架構下的上傳下載嗎?
uj5u.com熱心網友回復:
可以,20分,直接從手冊上拷貝好了The following example uploads the file to the application's virtual root d:\hhh directory on the server, sets the color of the Upload Files dialog box to the background color of the w_main application window, limits the number of files to be uploaded in a single operation to 3, does not display the server directory name in the Upload Files dialog box but does display the "my description" text, and limits the types of files that can be uploaded to JPG and TXT files:
#if defined PBWEBFORM then
UploadFiles("d:\hhh", w_main.BackColor, 3, false, "my description", ".jpg;.txt", "myuploadfiles_callback", w_main)
#end if
The following example opens the file aaa.txt in download mode:
#if defined PBWEBFORM then
DownloadFile("c:\aaa.txt", false)
#end if
The download mode causes the File Download dialog box to display, giving the user the choice of opening the file, saving the file, or cancelling the operation. The File Download dialog box displays the file name, the file type, the number of bytes in the file, and the name of the server that hosts the file.
The following code opens a dialog box that allows users to select a directory and download multiple files from the same directory:
string docpath, docname[]
boolean lb_openinteger i, li_cnt, li_rtn, li_filenum
lb_open = true //or false
li_rtn = GetFileOpenName("Select File", docpath, & + docname[], "DOC", & + "Text Files (*.TXT),*.TXT," & + "Doc Files (*.DOC),*.DOC," & + "All Files (*.*), *.*", & "C:\Program Files\Sybase", 18)
IF li_rtn < 1 THEN returnli_cnt = Upperbound(docname)
// if only one file is picked, docpath contains the // path and file nameif li_cnt = 1 then mle_1.text = string(docpath) #if defined PBWEBFORM then DownloadFile(string(docpath), lb_open) #end ifelse
// if multiple files are picked, docpath contains // the path only - concatenate docpath and docname
for i=1 to li_cnt
string s
s = string(docpath) + "\" +(string(docname[i]))
#if defined PBWEBFORM then
DownloadFile(s, lb_open)
#end if
mle_1.text += s +"~r~n"
next
end if
uj5u.com熱心網友回復:
F1上有?遠程資料上傳下載,用這個可以?uj5u.com熱心網友回復:
可以uj5u.com熱心網友回復:
查一下PB的幫助,這些東東里面都有轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/99394.html
標籤:Web 應用
上一篇:請教關于自動排崗的問題
下一篇:高手們請賜教,謝謝你們了!PB能使動態文本框背景透明嗎?諸如“mle_1”控制元件,資料視窗背景能透明也行!見詳述~
