473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with Persits ASPUpload

(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.

Jul 19 '05 #1
3 3261
"John Rebbeck" wrote:

...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...

...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.

..Anyone got any ideas? I'm probably missing something
simple, I hope so.


What is preventing you from using two different forms or changing the form
action & enctype at submission?

http://msdn.microsoft.com/workshop/a...ies/action.asp
http://msdn.microsoft.com/workshop/a...es/enctype.asp
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #2
It's not clear to me why you are uploading anything when the user chooses to
do a deletion. Perhaps your form needs to be organized differently?

"John Rebbeck" <jo**@rebent.com> wrote in message
news:Or**************@TK2MSFTNGP10.phx.gbl...
(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.


Jul 19 '05 #3
I solved it by using 2 forms, but even then it was a pain. I had to submit
one of the forms to another file which is not consistent with the rest of
the site (oh well, it works).

Thanks
John
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vilmar Brazão de Oliveira | last post by:
Hi, How verify type or extension of file using ASPUPLOAD? I check documentation, but I didn't find anything else yet. thanks, -- ««««««««»»»»»»»»»»»»»» Vlmar Brazão de Oliveira...
8
by: BigJohnson | last post by:
We're using ASPUpload as a tool to upload files to our server and save the details to SQLServer. However, I have an application where I need to return the pkID of the just saved file. I'm assuming...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
5
by: the other john | last post by:
I'm not certain that what I'm asking is an AspUpload question or just a VBScript question. I am uploading a story with up to 3 pictures. Each picture uploads using aspupload with no problems. ...
4
by: PW | last post by:
I'm writing a small system to allow users to upload documents to my server. I'm using Persist AspUpload for this. I have 2 ASP files. In the first ASP file I prompt the user for a file...
0
by: RichBurdes | last post by:
Hi All, I've just started using ASPupload and can successfully submit files to a directory on the web server and form data to a database - i can then retrieve the form data and links to the files...
2
by: vinodkus | last post by:
Problem 1I m writing a code to upload a file There are two files form.asp, uploadScript1.asp Code for form1.asp <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta...
0
by: dann2 | last post by:
hello, i try to upload in an access db two pictures at the same time. i use the adjusted sample code from persits. it looks like this: ... '<% ' Create an instance of AspUpload object 'Set...
0
by: .Net Sports | last post by:
I'm using Persits.upload module in ASP, and when i use the following form pointed to the object I've always used, i get a "The system cannot find the file specified" error pointing to the line of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.