Hi All,
Since in the helpfiles and on the forum uploading is not discussed much, there fore I hope that with this Thread we can have a thread that will help all on the forum who is interested in uploading like worddocs and pictures for company logos or CV f.e....
I want to:
1] upload picture to WAS
2] write picture to certain directory "\Uploads\"
3] open existing file/record and write path+filename to record so that a company logo gets added to the record of that company...
Problems:
- aw5 page gives error within frames of frontpage, it only works in full webpage
- I cant write to the directory, how is this done?
See code below which has errors...,
thanks so much for anybodies help in this matter!
Edwin
Since in the helpfiles and on the forum uploading is not discussed much, there fore I hope that with this Thread we can have a thread that will help all on the forum who is interested in uploading like worddocs and pictures for company logos or CV f.e....
I want to:
1] upload picture to WAS
2] write picture to certain directory "\Uploads\"
3] open existing file/record and write path+filename to record so that a company logo gets added to the record of that company...
Problems:
- aw5 page gives error within frames of frontpage, it only works in full webpage
- I cant write to the directory, how is this done?
See code below which has errors...,
thanks so much for anybodies help in this matter!
Edwin
Code:
<html> <head> <meta NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <title></title> <html> <%A5 if eval_valid("cmd") dim msg as c = "" dim fn as C dim tbl as P dim indx_Comp_ID as P fn = FileToUpload.filename file.from_blob(fn, FileToUpload.data) msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />" ? msg tbl = table.open("[PathAlias.ADB_Path]\companymembers.dbf") indx_Comp_ID = tbl.index_primary_put("Comp_ID") tbl.fetch_find(session.__protected__UserID) tbl.change_begin() tbl.Comp_logo = fn tbl.change_end(.T.) tbl.close() end if %> <head> <title>File Upload example</title> </head> <body bgcolor="#ffffff"> <form action=" <%A5 ? request.script_name %> " method="POST" enctype="multipart/form-data"> <input type="file" name="FileToUpload" value=""><br /> <input type="submit" name="cmd" value="Upload File/Logo"> </form> </body> </html> </head> <body> <p> </p> </body> </html>
Comment