|
|
|
ช่วยหน่อยครับผมใช้ aspsmartupload แล้ว error ไม่ให้ใช้คำสั่ง request.from ครับ |
|
|
|
|
|
|
|
พอดี ผมจะทำหน้า อัพโหลดรูปภาพ พร้อมกับข้อมูลจาก from อื่น ๆ ครับ
ช่วยหน่อยครับ Error ว่า
ขอบคุณครับ
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/kc/eng/shopping_confirmpayment_inc.asp, line 68
----**************************************
Error อันนี้ครับ fname = request.from("fname")
----***************************************
ลองใช้ fname = uploaddata.Item("fname").Item("value") ก้อไม่ได้ครับ
----****************************************
Code (ASP)
<form action="AspUploadResize2.asp" method="post" enctype="multipart/form-data" name="frmMain">
Upload
<input name="file1" type="file">
<input type="text" name="fname" value="">
<input type="submit" name="Submit" value="Submit">
</form>
----*****************************************
Code (ASP)
<% Option Explicit %>
<!--#include file="conn_product.asp" -->
<html>
<head>
<title></title>
</head>
<body>
<%
Dim mySmartUpload
Dim Conn,strSQL,objExec
Dim orderid,rsconfirm,date_pay,fname
'*** Create Object ***'
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
'*** Upload Files ***'
mySmartUpload.Upload
Dim sFileName,strPath
strPath = "../picture_payment"
sFileName = mySmartUpload.Files("file1").FileName
'*** Upload file1 ***'
If mySmartUpload.Files("file1").FileName <> "" Then
mySmartUpload.Files("file1").SaveAs(Server.MapPath(strPath & "/" & sFileName))
Response.write sFileName & " Resize Successful.<br>"
'*** Resize Images ***'
Dim Chs, objConst,NewWidth,NewHeight
Dim OutFormat,OutFileName
OutFormat = "Jpg" '*** Gif,Png ***'
OutFileName = "Thumbnails_"&sFileName
NewWidth = "100" '*** Set new Width , Height automatic caculate ***'
NewHeight = 0 '*** Auto Resize ***'
'*** Get Images Width & Height ***'
Dim objFso,myImg,Width,Height
Set objFso = CreateObject("Scripting.FileSystemObject")
IF objFso.FileExists(Server.MapPath(strPath&"/"&sFileName)) Then
set myImg = Loadpicture(Server.MapPath(strPath&"/"&sFileName))
Width = Round(myImg.width / 26.4583)
Height = Round(myImg.height / 26.4583)
NewHeight = Round((NewWidth*Height)/Width)
'NewHeight = 100
'NewWidth = Round((NewHeight*Width)/Height) '*** or Automatic Height ***'
End If
'*************** End *************'
Set Chs = Server.CreateObject("OWC10.ChartSpace")
Set objConst = Chs.Constants
Chs.Interior.SetTextured Server.MapPath(strPath&"/"&sFileName), objConst.chStretchPlot, , objConst.chAllFaces
Chs.border.color = -3
'Chs.border.color = &H0000FF
'Chs.border.Weight = 3
Chs.ExportPicture Server.MapPath(strPath&"/"&OutFileName),OutFormat,NewWidth,NewHeight
Set objConst = Nothing
Set Chs = Nothing
'orderid = request.QueryString("orderid")
'date_pay = request.Form("day_pay") & "/" & request.Form("month_pay") & "/" & request.Form("year_pay")
fname = request.from("fname")
strSQL = ""
strSQL = strSQL &"INSERT INTO confirm_payment_eng"
strSQL = strSQL &"(fname,pic_picture) VALUES ('"&fname&"','"&sFileName&"')"
Set objExec = Conn.Execute(strSQL)
Response.write("View files")
end if
Set mySmartUpload = Nothing
%>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
2010-07-23 14:24:19 |
By :
ntt007 |
View :
1263 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|