J
John Rebbeck
(sorry about cross posting but I really need help with this and it fits in
both newsgroups)
I'm creating a little image manager and I'm using Persits ASPUpload. I have
an UploadButton and DeleteButton which are both submits. Normally I would
do:
code:-----------------------------------------------------------------------
-------
If Request.Form("UploadButton") <> "" Then
' perform the upload
Else If Request.Form("DeleteButton") <> "" Then
' perform deletion
End If
----------------------------------------------------------------------------
--
....but as some of you may know you can't use Request.Form when using
ASPUpload because the form requires have the enctype="multipart/form-data"
attribute which makes Request.Form unavailable.
It is however possible to access it like:
code:-----------------------------------------------------------------------
-------
Dim upload : Set upload = Server.CreateObject("Persits.ASPUpload")
upload.Save("c:\somewhere")
Response.Write(upload.Form("UploadButton")) ' writes the value of
UploadButton
----------------------------------------------------------------------------
--
....but I want to only perform the upload when the upload button has been
clicked. To access upload.Form(...) to check if the button has been clicked
you must first call upload.Save, which uploads the files and populates the
upload.Form property.
This is a strange problem. I'm sure I could get around it by uploading to a
temp dir and then copying to the final directory if the upload button has
been clicked, or upload them then delete them again if upload button was not
clicked, but I shouldn't have to.
Anyone got any ideas? I'm probably missing something simple, I hope so.
Thanks in advance.
both newsgroups)
I'm creating a little image manager and I'm using Persits ASPUpload. I have
an UploadButton and DeleteButton which are both submits. Normally I would
do:
code:-----------------------------------------------------------------------
-------
If Request.Form("UploadButton") <> "" Then
' perform the upload
Else If Request.Form("DeleteButton") <> "" Then
' perform deletion
End If
----------------------------------------------------------------------------
--
....but as some of you may know you can't use Request.Form when using
ASPUpload because the form requires have the enctype="multipart/form-data"
attribute which makes Request.Form unavailable.
It is however possible to access it like:
code:-----------------------------------------------------------------------
-------
Dim upload : Set upload = Server.CreateObject("Persits.ASPUpload")
upload.Save("c:\somewhere")
Response.Write(upload.Form("UploadButton")) ' writes the value of
UploadButton
----------------------------------------------------------------------------
--
....but I want to only perform the upload when the upload button has been
clicked. To access upload.Form(...) to check if the button has been clicked
you must first call upload.Save, which uploads the files and populates the
upload.Form property.
This is a strange problem. I'm sure I could get around it by uploading to a
temp dir and then copying to the final directory if the upload button has
been clicked, or upload them then delete them again if upload button was not
clicked, but I shouldn't have to.
Anyone got any ideas? I'm probably missing something simple, I hope so.
Thanks in advance.