When the form is submitted as ENCTYPE="multip art/form-data" using AspUpload component, I understand to use Upload.form("") to retreive the form elements. But I cannot retreive it from inside a class.
Anybody can help?
The form page goes to upload.asp, where inside upload.asp it calls the class which reads the form element and return back the values.
Here is the code of the class. - Class pluginFileTransfer
-
Public path, blnoverwrite, maxfilesize, SelectImageWidth
-
Public uploadedFileName, uploadedFileSize, uploadedFilePath, uploaded_error
-
Public contentType
-
-
-
' Create objects required by the plugin
-
' The 3rd party component etc.
-
Private Sub Class_Initialize()
-
'ObjFso is already available so the following line is commented out
-
'Set ObjFSO = server.CreateObject ("Scripting.FileSystemObject")
-
Set aspUpload = Server.CreateObject("Persits.Upload")
-
aspUpload.ProgressID = Request.QueryString("PID")
-
-
End Sub
-
-
' Destroy objects
-
Private Sub Class_Terminate()
-
'Set ObjFso = Nothing
-
Set aspUpload = Nothing
-
End Sub
-
-
' Upload the posted file
-
' Return values: 0 - success, 1 - no file sent, 2 - path not found, 3 - write error, 4 - extension not allowed
-
' The public variable path (save location) should be set prior to calling this function.
-
' The public variables uploadedFileName, uploadedFileSize and contentType should be set before exiting this function.
-
Public Function Upload()
-
Dim file
-
-
on error resume next
-
-
If AspUpload.Form("select_filewidth") = "2" Then
-
SelectImageWidth = 2
-
Elseif AspUpload.Form("select_filewidth") = "1" Then
-
SelectImageWidth = 1
-
Else
-
SelectImageWidth = 0
-
End If
-
SelectImageWidth = cstr(AspUpload.Form("select_filewidth"))
-
-
aspUpload.OverwriteFiles = blnoverwrite
-
aspUpload.SetMaxSize maxfilesize, True
-
-
aspUpload.Save
-
'File.SaveAs path & "\" & File.FileName
-
Set File = aspUpload.Files("image_url0")
-
-
-
Set ObjFSO = server.CreateObject ("Scripting.FileSystemObject")
-
-
If file is nothing Then
-
Upload = 1
-
ElseIf not ObjFso.FolderExists(Server.MapPath(path)) Then
-
Upload = 2
-
Else
-
uploadedFileName = file.ExtractFileName
-
'Code where the file is uploaded
-
End If
-
Set ObjFso = Nothing
-
End Function
-
-
-
' --- Internal variables and functions specific to this plugin only (non standard) ---
-
' Here, the private variables, functions specific to this plugin can be defined.
-
Private aspUpload
-
End Class
0 3150 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John Davis |
last post by:
I want to know what's the differences between
Request.Form("Field Name") and
Request.QueryString("Field Name")
OR they function exactly the same, which is to return the value of the
field??
Thanks,
John
|
by: Mindful_Spirit |
last post by:
I'm trying to set up a basic email feed back form
like
this, and was wondering about some basic configuration settings. I
have used code from
this
website. I have it working just fine. I'm running IIS on my home
machine.
My problem is that I need to upload this stuff to a webhosting place and
register a domain and I'm not sure what to put as the smtp mail server value
|
by: Pavils Jurjans |
last post by:
Hello,
I have bumped upon this problem: I do some client-side form processing
with JavaScript, and for this I loop over all the forms in the
document. In order to identify them, I read their "name" property
(which sources from "name" HTML attribue). The problem is, that if the
form contains form control named "name", it overwrites the form name
property. In fact, I'm quite surprised that it's so easy to spoil any
of the form object...
|
by: Pete Wilson |
last post by:
Hi folks --
The page at
http://www.pwilson.net/submit-demo.html
will not validate. The validator at http://validator.w3.org tells me I
can't have an input inside a form.
Would some kind soul please tell me what I'm doing wrong?
|
by: Mark |
last post by:
Hi all,
Is there a "standard" way to structure a small windows form such that it can
run non-interactively with an appropriate command line switch?
E.g, if I run the form normally I get the form's UI, but if I run it with /q
(or whatever), it runs non-interactively (perhaps logging to the event log).
I did try parsing the command line in Main(), but of course Main is static
and it's not possible therefore to use some field or method...
| |
by: Marty |
last post by:
Hi,
How do we make a form "stick" to another window (something like Winamp)?
I'm using C# .NET 2003.
Thank you very much.
Marty
|
by: Dan |
last post by:
I am trying to use
Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "".
I am not really sure why, this happens for all of my controls that invoke are invoking a post back.
I've never used this type of method before, but I need to get the name of the control doing the postback in the Form Load event, and cannot wait until the event of the target control that runs due to the...
|
by: KiwiGenie |
last post by:
Hi..I am trying to make a search form. I am fairly new to access and could well be looking at it completely wrong. I have an unbound form with textboxes in the header for entering different search criteria.
I have a subform for displaying the results, which is bound to Query4. SQL for Query4 (taken from sql view in query):
SELECT tblRecipes.RecipeName, tblRecipes.FoodCategory, Sum(Query3.IngredCost) AS SumOfIngredCost, Query3.RecipeID
FROM...
|
by: eBob.com |
last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything
about the form which brought it into existence, i.e., I suppose,
instantiated it? I wanted to so something like this ...
MsgBox("called by " & Owner.Name)
.... but that throws a null reference exception. Parent.Name and
ParentForm.Name also throw null reference exceptions. Form1.Name works -
but that's not very flexible.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |