![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to pass a session variable to a form in ASP instead of the formfield itself ? This is so I can store the entire path and filename I am uploading as I use it many times in several forms on the same page. The asp page code bit I have changed and doesn't work is:- INPUT TYPE="FILE" NAME="<%= Session("file") %>" size="80" Any ideas please anyone ? |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Hi Now I'm getting this when I run it:- 'File saved successfully on the server as: Object required' The response page (part of code only) is:- ======================== % Dim oFileUp dim pathname dim FileSizeInBytes FileSizeInBytes = request.totalbytes '--- Instantiate the FileUp object Set oFileUp = Server.CreateObject("SoftArtisans.FileUp") oFileUp.OverwriteFiles = False pathname = "/PropertyImages/" & cstr((GetCountryName.Fields.Item("CountryName").Va lue)) 'Get the right path to save the image to bfore saving... 'pathname = "/PropertyImages/" & cstr(oFileUp.form("CountryForImage")) 'Get the right path to save the image to bfore saving... '--- Set the Path property to the location you wish to temporarily cache the incoming file before saving oFileUp.Path = Server.MapPath(pathname) '--- Check if a file was selected (myFile is coming from the html code) '--- If so, continue processing If Not oFileUp.Form("myFile").IsEmpty Then If FileSizeInBytes <= 105582 Then 'File must not be larger than 100 Kb. 'response.write upload.form("CountryForImage") '--- Save the file oFileUp.Form("myFile").Save '--- The file is saved, display a confirmation message Response.Write ("<B>File saved successfully on the server as:</B><BR>") '--- The ServerName() property is the full path of the file where it was saved on the server Response.Write(oFileUp.Form("myFile").ServerName) Else Response.Write("Error: File was larger than 100 Kb...") End if Else Response.Write("Error: There was no file submitted for upload.") End If ================ Any other resons why it won't go - the type of the file is BinaryREAD - MULTIPART... ? |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |