Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requesting data from a file field whilst uploading from it 1

Status
Not open for further replies.

walderr

Programmer
Jul 18, 2003
32
GB
Right, this should be quick and easy in theory: I'm using a pure upload to upload documents and update a database at the same time. If the user chooses not to upload a file (ie leaves the file field blank), I want to either keep the database the same, or insert some other text if the field for that record is currently blank. It appears that you can't just request the file field ("PictureLocationField", see code below) using "Uploader.Form" when you're uploading from it, as it always returns as blank. Is there a way that I can vary my output depending on whether the user inserts text in this field or not?


If type_of_submit = "Amend" Then
objRS("ID Number") = IDNumber
objRS("Part Name") = PartName
objRS("Custodian") = Custodian
objRS("Date Last Modified") = UpdateModified
objRS("Date Added") = UpdateAdded
objRS("Country") = Country
objRS("Part Application") = PartApplication

If PictureLocationField = "" then
If PictureServerPath = "" then
objRS("Picture Server Path") = "Images/noimage.jpg"
objRS("Picture File") = "noimage.jpg"
else
objRS("Picture Server Path") = PictureServerPath
objRS("Picture File") = PictureFile
end If
else
objRS("Picture Server Path") = UpdatePictureServerPath
objRS("Picture File") = UpdatePictureFile
end If

end If
objRS.Update
 
Hi...
as you have Uploader.Form, you also shuld have Uploader.File (I think the Uploader is an instance of your object) and this object, shuld have a property like Count or something like it which you can check :
If Uploader.File.Cound > 0 Then
Do something...
Else
Do Something else
End If

----
TNX.
E.T.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top