Hi,
Can anyone help me with uploading a file with a message. I am using...
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadIt.asp">
<table width="70%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td><TEXTAREA wrap="on" NAME="messagetxt" TABINDEX="1" ROWS="5" COLS="70"></TEXTAREA></td>
</tr>
<tr>
<td><P class="centerIt">Upload a picture to go with your message.</P></td>
</tr>
<tr>
<td align="center" width=90%" ><P>Filename: <INPUT TYPE="file" NAME="userimage" tabindex="2"></P></td>
</tr>
<tr>
<td align="center" ><input type="submit" name="Upload" value="Upload" tabindex="4"></td>
</tr>
</table>
</form>
As the form and...
<%
'some code here
MessageTxt = request("messagetxt"
Set Upload = Server.CreateObject("Persits.Upload.1"
Upload.OverwriteFiles = False
Upload.SetMaxSize 50000, true
Upload.Save "bla bla bla"
For Each File in Upload.Files
If File.ImageType <> "GIF" and File.ImageType <> "JPG" Then
File.Delete
Response.redirect "bla bla bla"
Response.End
exit for
end if
next
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.ConnectionTimeout = Session("ConnectionTimeout"
OBJdbConnection.CommandTimeout = Session("CommandTimeout"
OBJdbConnection.Open Session("ConnectionString"
theSQL = "insert into message_board "
theSQL = theSQL & "(sentby_username, messagetext, picture_link)"
theSQL = theSQL & " values ('"&Session("username"
&"', '"& MessageTxt &"', '" & NewImageFile & "')"
'*****Write to DB*****
OBJdbConnection.Execute(theSQL)
OBJdbConnection.close
Set OBJdbConnection = Nothing %>
...to process it.
The file gets uploaded but the MessageTxt part gets lost.
Is there any way round this and what am i missing?
Many thanks in advance.
Al
Can anyone help me with uploading a file with a message. I am using...
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadIt.asp">
<table width="70%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td><TEXTAREA wrap="on" NAME="messagetxt" TABINDEX="1" ROWS="5" COLS="70"></TEXTAREA></td>
</tr>
<tr>
<td><P class="centerIt">Upload a picture to go with your message.</P></td>
</tr>
<tr>
<td align="center" width=90%" ><P>Filename: <INPUT TYPE="file" NAME="userimage" tabindex="2"></P></td>
</tr>
<tr>
<td align="center" ><input type="submit" name="Upload" value="Upload" tabindex="4"></td>
</tr>
</table>
</form>
As the form and...
<%
'some code here
MessageTxt = request("messagetxt"
Set Upload = Server.CreateObject("Persits.Upload.1"
Upload.OverwriteFiles = False
Upload.SetMaxSize 50000, true
Upload.Save "bla bla bla"
For Each File in Upload.Files
If File.ImageType <> "GIF" and File.ImageType <> "JPG" Then
File.Delete
Response.redirect "bla bla bla"
Response.End
exit for
end if
next
Set OBJdbConnection = Server.CreateObject("ADODB.Connection"
OBJdbConnection.ConnectionTimeout = Session("ConnectionTimeout"
OBJdbConnection.CommandTimeout = Session("CommandTimeout"
OBJdbConnection.Open Session("ConnectionString"
theSQL = "insert into message_board "
theSQL = theSQL & "(sentby_username, messagetext, picture_link)"
theSQL = theSQL & " values ('"&Session("username"
'*****Write to DB*****
OBJdbConnection.Execute(theSQL)
OBJdbConnection.close
Set OBJdbConnection = Nothing %>
...to process it.
The file gets uploaded but the MessageTxt part gets lost.
Is there any way round this and what am i missing?
Many thanks in advance.
Al