Rank: Newbie
Groups: Member
Joined: 8/24/2012(UTC) Posts: 3
|
Dmitry.Obukhov wrote:Hello Salman, Please post the complete code. Hi Dmitry. Please find my code below. In the <head> tag: Code:
<head>
<meta charset="utf-8">
<title>Aurigma Upload Suite 8 Demo Applications — Basic demo
</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="Scripts/css/aurigma.htmluploader.control.css" />
<script src="Scripts/aurigma.htmluploader.control.js" type="text/javascript"></script>
<script src="Scripts/aurigma.imageuploaderflash.min.js" type="text/javascript"></script>
</head>
The Javascript inside the <body>: Code:
<div class="code">
<script type="text/javascript">
//<![CDATA[
function test()
{
var uploader = $au.imageUploaderFlash({
id: 'Uploader1',
licenseKey: '77FF4-0046C-89592-C8E2C-8EF67-2600BE',
width: '100%',
height: '500px',
converters: [
{ mode: '*.*=SourceFile' }
],
uploadSettings: {
actionUrl: 'upload2.a5w',
redirectUrl: 'Default.a5w'
},
flashControl: {
codeBase: 'Scripts/aurigma.imageuploaderflash.swf',
bgColor: '#f5f5f5'
},
restrictions: {
fileMask: [['Images (*.jpg; *.jpeg; *.png; *.gif; *.bmp)', '*.jpg;*.jpeg;*.png;*.gif;*.bmp'], ['Documents (*.txt;*.rtf;*.pdf;*.doc;*.docx;*.xls;*.xlsx)', '*.txt;*.rtf;*.pdf;*.doc;*.docx;*.xls;*.xlsx']]
}
});
uploader.writeHtml();
}
//]]>
</script>
<input type="button" value="Xbasic upload" name="Upload" onclick="javascript: test();"></input>
</div>
In the Upload file: Code:
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="Alpha Five HTML Editor Version 11 Build 2211-3815">
<!-- must use in order to make XP Themes render -->
<meta HTTP-EQUIV="MSThemeCompatible" content="Yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<%a5
function saveFiles as v (e as p)
dim count as n
count = e.filecount
dim i as n
dim arr as p
arr = e.filearray
dim cn as sql::connection
dim cs as c
cs = cn.open("{A5API=MySQL,Server='localhost',Port='3306',UserName='root',Password='XXXXXX',Database='XXXXXX'}")
'cs = e.tmpl.cs.connectionstring
cn.open(cs)
dim sql as c
sql = "insert into patient (Examid, Filmid, Image, Pid) values ('1', :customerId, :filename, '1')"
dim args as sql::arguments
args.add("customerId",e.primaryKeyArray[1])
for i = 1 to count
dim fn as c
dim data as c
data = e.fileArray[i].data
fn = "<file path>" + chr(92) + e.fileArray[i].fileName
?"value in fn: " + fn
save_to_file(fn, "D:\tt1.txt")
%>
<br>
<%a5
file.from_string(fn,data) 'From_blob(fn,data)
dim fntoStore as c
fntoStore = e.fileArray[i].fileName
args.add("filename",fntoStore)
dim flag as l
flag = cn.Execute(sql,args)
if flag = .f. then
e.javascript = "alert('Fatal error');"
cn.close()
exit function
end if
next i
cn.close()
e.javascript = "window.parent.{grid.object}.refreshLinkedContent();"
end function
%>
</head>
<body>
</body></html>
<%a5
'Start of Saved Debug Variables
''Examples:
''request.variables.button_clicked = "Search"
''session.firstname = "Fred"
'End of Saved Debug Variables
%>
|