Requesting data from a file field whilst uploading from it

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"
objRS("Picture Server Path") = PictureServerPath
objRS("Picture File") = PictureFile
end If
objRS("Picture Server Path") = UpdatePictureServerPath
objRS("Picture File") = UpdatePictureFile
end If

end If

Posted On: Tuesday 16th of October 2012 03:32:39 AM Total Views:  806
View Complete with Replies

Related Messages:

Web Page dsn less hook up to Access database   (519 Views)
Hi:I am trying to put my asp program on a web server and trying to call up an access database. Should be simple. I have done several on my hard drive, works fine. I need to have it work on a web page. I called the server and they said i need a dsn less code hookup. Went on google found one but not working.Here is the code I have:set cnn = server.createobject("ADODB.Connection") "DRIVER={Microsoft Access Driver(*.mdb)};DBQ=c:\test\testDB.mdb"Here is the error I get:Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. /test/dsn.asp, line 6 line 6 is the second line above starting with'm not sure if its just a path problem. On the server, the database is on the same level as the asp program, in a file called test
not finding database???   (392 Views)
New with asp, but learning and this forum has been a great help.I am making a simple sign up form in asp. I am getting an error:"Data source name not found and no default driver specified"I have the database set up with the appropriate tables and fields and in the same directory as the website. The database is under a folder 'fpdb' in the directory. Why is it not finding the database Isnt that what the error meansI have other pages set up this way and it works. Did I forget something ---------------------Dim ConnDim strSQLSET Conn = server.createobject("ADODB.Connection")Conn.Open "Database"strSQL = "INSERT INTO SignUp(Name, Email, School, Major, Event, Organization) VALUES ('"+ Change(Request.Form("Name")) +"', '"+ Change(Request.Form("Email")) +"', '"+ Change(Request.Form("School")) +"', '"+ Request.Form("Major") +"', '"+ Request.Form("Event") +"', '"+ Change(Request.Form("Organization")) +"')"Conn.Execute(strSQL)Conn.closeset Conn = nothing------------------------
How to write image data to binary PGM file format(P5)?   (331 Views)
Hi all, I fail to write the image data to binary PGM format (P5). Let's say i have to write a image data into PGM P5 format. I have the information for width, height, Y_min, Y_max, XL, XR and the TEMPLATE1 (data matrix) ==>A region of interest from an image. Y_min & Y_max = minimum and maximum of the height value. XL & XR = min and max of the width value for the image. First, i call the subroutine, write_data_grey_binary(width1,height1,XL1,XR1,Y_min1,Y_max1,filename99[total],TEMPLATE1); (Toggle Plain Text) void write_data_grey_binary(width,height,XL,XR,Y_min,Y_max,filename,output) int width,height,XL,XR,Y_min,Y_max; char *filename; unsigned char** output; { int i,j,nread; FILE *fp; unsigned char* temp; if((fp = fopen(filename,"w")) == NULL){ printf("File 333 output data can not open\n"); exit(1); } fprintf(fp,"P5\n%d %d\n%d\n",width,height,(GRYSCL-1)); temp = (unsigned char*)calloc(height*width, sizeof(unsigned char)); for(i=Y_min;i
data structures using array   (509 Views)
hi i would like to ask about data structure using array!!! if you have some program, can i have some just for me to understand it as a beginner!!!!
executing code in the data segment   (381 Views)
I'm attempting to execute code in the data segement, but I can't really seem to find much on this topic. Here's an overview of what I have now: (Toggle Plain Text) unsigned char block[50] = {0}; /* ...code to fill block with machine instructions here... */ /* try to execute the block with an assembly call */ __asm__ ( "mov %0, %%eax;\ call *%%eax;" : /* no output */ : "r" (block) /* input variable, replaces %0 in above code */ : "eax" /* tell gcc eax may have changed */ ); unsigned char block[50] = {0}; /* ...code to fill block with machine instructions here... */ /* try to execute the block with an assembly call */ __asm__ ( "mov %0, %%eax;\ call *%%eax;" : /* no output */ : "r" (block) /* input variable, replaces %0 in above code */ : "eax" /* tell gcc eax may have changed */ );
Writing data to a local text file   (354 Views)
What is the easiest way to write data to a local text file (on the client PC) using an ASP page
ASP url Variable to insert database   (357 Views)
Problem:I have saving value of a variable passed by url Add. I want insert this variable to messageID field in a database. MessageID has number value and I am saying in the requesting page: RS.Fields("messageID")=Request("id")It's inserting blank value. The url is appears like this /message.aspid=1 and I am assuming id has value assigned but does not insert into the database. Could anyone help me with this. I don't want use session variable since I already have two many of them
urgent! getting uniqueidentifier from database!   (536 Views)
Here's my problem. We just found out our entire payment system for our e-commerce website is incorrect due to a bug in one of the pages. The code is below: Set rsDelItem = Server.CreateObject("ADODB.Recordset")strDelSQL = "Delete FROM Orders where Serial = " & Request("cart_order_id") & " " rsDelItem.Open strDelSQL, objConnWhat's happening is 'Serial' is a column in the database that is of type 'uniqueidentifier' (It's like an autonumber, except it looks like this: {84A25A73-D5E7-D549-F046-02EEF8BF739D}... ) We've got the uniqueid in a string format and keep getting the error:"Syntax error converting from a character string to uniqueidentifier"...The person who designed this portion of our site is gone and I'm left to try to deal with it but this has got me tripped up. I've got absolutely no clue how to convert a character string to a uniqueidentifier! They're the same thing. The character string IS a uniqueid from another page, it was just passed to this page in the form of a string and I don't know how to change it back. Can anybody help Cyprus
Connecting to a mysql database and my SQL scripting help   (421 Views)
I need help on some mysql stuff. 1) How do I connect to a mysql db with ASP2) Is this correct mySQL I use MS-SQL on my computer with PWS and that stuff but I want to make some live stuff so is this right.insert updates (username, posted_date, post_subject, post_body, user_email)values('MrSaturn', current_timestamp, 'Subject', 'body', 'email')where greg_ebmdb.dbo.user_list.user_alias = 'MrSaturn' and users.user_pwd = 'randompassword
show data user want to display?   (467 Views)
I just want to add a function to my website allowing user to select items they want to show and allowing user to set their search criteria. The number of record queried should and the records themselves will be displayed on the page. Does anybody have any idea how to doing that If you know how, could you give me a example. Actually I have figured out how to get the query based upon user's choices. But how to display uncertain number of field in a table is my problem. Thanklongmatch
How to put data back to ASP generated drop down list?   (424 Views)
I wrote ASP code to generate javascript code for linked dropdown lists using backend database data. Please see the code below. I have no problem to generate the drop down and collect data using it. But when I want to put the data back to this drop down list, I find it is difficult. Anybody have an ide
how to export data to Excel?   (391 Views)
,I want to know how to export data to Excel from ASP form. I try to create a "Export" button to export data to Excel, but I don't know how..
Checking the database before submitting a form   (398 Views)
Hi all,I have a form where the user can submit their e-mail address. Before the form submits, I'd like to check if the e-mail address already exists in my database, and if it does, open a javascript alert window which says "e-mail already exists". I've been having alot of problems finding a good, clean way to do this
Using ASP to access remote SQL database   (556 Views)
, Have a bit of a tricky one here, and wondering if anyone could help me out. The problem involves allowing my ISP hosted ASP 3.0 pages to access and internal SQL server database. Does anyone know how this can best (if at all) be done From wat we have come up with, there are two possible solutions: 1. Configure our firewall so that only our ISP can get through on SQL port to query, but that does not provide enough security as SQL level access will send passwords in clear text (not acceptable for required security level), and this may at the same time expose our production database. 2. Create some kind of Web service (an ASP page) that locally queries the database, and have our external ASP page query the internal page (is this even possible). This would allow for the only opening up ports from our ISPs IP to our webserver for HTTP traffic. (Again, hosting the actual external page ourselves is not an option due to bandwidth considerations). The second idea seems preferable, but i have no idea how i'd go about it. Any ideas Any help or advice on either of the above two options (or in general) would be greatly appreciated, as i know it would be very difficult to not know more than i do!! Many
Image upload - file system vs database   (398 Views)
Your advice please! I have built an image upload facility, for a web project that I have developed. Currently, images are stored in the file system on the web server. However, I am also aware that it is possible to store images in the database. What would be the trade off (ie any advantages / disadvantages / known problems etc), should I decide to upload to the database instead of the file system. Is there a preferred way to where images are stored. At the moment, images are stored in folders which are named after a project code number. Immediately, I see this structure becoming out of hand (as we have close to 200+ projects a year). Does anyone know of alternative naming convention for thi
Using ASP for large (over 1GB) databases   (530 Views)
would it be wise to use an internet/ASP setupfor users to ftp or email databases of over 1Gigin size, and then process the data on a serverOr- would you recommend creating a PC softwarepackage in which the user would NOT have totransfer such a large file
asp pages and access database...   (516 Views)
A bit of bg first.I have a working access database with a web front-end for adding, viewing, editing and deleting events.The bits that are illuding me at the moment are.Setting the format of the date when it is displayed.(I have this set how I want it in the database)Getting the results to display in date order.any help will be appriciated.Thanx in advance Manic-----------------------------I've broken it again !!
Passing an ASP variable to a database using SQL   (485 Views)
I created an ASP page that will generate a random number. I have a variable set to catch the number. now, i want to pass that variable to a field in my database using a SQL statement, INSERT INTO......I am also passing data from a form into my database using Reqest.Form("LastName"). My code looks like this: mySQL= "INSERT INTO PreApprovalDetail " mySQL= mySQL & "(PreApproval#,LastName,FirstName,CurrOrg,CurrBldg,CurrRoom,NewOrg,NewBldg,NewFloor,NewRoom) "mySQL= mySQL & "VALUES ('" & "PreApp" & "','" mySQL= mySQL & request.form("LastName") & "','"mySQL= mySQL & request.form("FirstName") & "','"mySQL= mySQL & request.form("CurrOrg") & "','"mySQL= mySQL & request.form("CurrBldg") & "','"mySQL= mySQL & request.form("CurrRoom") & "','"mySQL= mySQL & request.form("NewOrg") & "','"mySQL= mySQL & request.form("NewBldg") & "','"mySQL= mySQL & request.form("NewFloor") & "','"mySQL= mySQL & request.form("NewRoom") & "')"myConnection.Execute(mySQL)It works ok, until i want to insert that PreApp. I am hoping it is a syntax error. Oh, I should mention that i am NOT a programmer by any means.....just trying to figure out a school project.
Sending input data via a link   (278 Views)
Hi ,Is it possible to send input data via a link I am not talking about submitting the form. I want to add the values of the text boxes to a link. I've tried using the input name.Value, but keep getting a message something like "name" is not defined. Is there a way to do what I'm trying to do Any suggestions would be appreciated
Saving form data to database   (343 Views)
HELLLLLLLLLLP! I used MS FrontPage's database interface to create a webpage that is supposed to save the form data to the database. I created and verified the connection between the db & webpage. I can enter information into the webpage (, and I receive a confirmation page, but it doesn't save the information to the database. Can anyone help me figure out what I am doing wrong