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
\t\t\t\t\t\t\tobjRS("ID Number") = IDNumber
\t\t\t\t\t\t\tobjRS("Part Name") = PartName
\t\t\t\t\tobjRS("Custodian") = Custodian
\t\t\t\t\tobjRS("Date Last Modified") = UpdateModified
\t\t\t\t\tobjRS("Date Added") = UpdateAdded
\t\t\t\t\tobjRS("Country") = Country
\t\t\t\t\tobjRS("Part Application") = PartApplication

\t\tIf PictureLocationField = "" then
\t\t\t\t\t\t\t\t\tIf PictureServerPath = "" then
\t\t\t\t\t\t\t\t\t\t\t\tobjRS("Picture Server Path") = "Images/noimage.jpg"
\t\t\t\t\t\t\t\t\t\t\t\tobjRS("Picture File") = "noimage.jpg"
\t\t\t\t\t\t\t\t\telse
\t\t\t\t\t\t\t\t\t\t\t\tobjRS("Picture Server Path") = PictureServerPath
\t\t\t\t\t\t\t\t\t\t\t\tobjRS("Picture File") = PictureFile
\t\t\t\t\t\t\t\t\tend If
\t\telse
\t\t\t\tobjRS("Picture Server Path") = UpdatePictureServerPath
\t\t\t\tobjRS("Picture File") = UpdatePictureFile
\t\tend If
\t\t
end If
objRS.Update
Posted On: Tuesday 16th of October 2012 03:32:39 AM Total Views:  430
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




Web Page dsn less hook up to Access database

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")cnn.open "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 cnn.open....I'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
VIEWS ON THIS POST

277

Posted on:

Tuesday 16th October 2012
View Replies!

not finding database???

New with asp, but learning and this forum has been a great help.I am making a simple sign up form in asp.\tI 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.\tThe database is under a folder 'fpdb' in the directory.\tWhy is it not finding the database\tIsnt that what the error meansI have other pages set up this way and it works.\tDid I forget something\t---------------------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------------------------
VIEWS ON THIS POST

216

Posted on:

Tuesday 16th October 2012
View Replies!

How to write image data to binary PGM file format(P5)?

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
VIEWS ON THIS POST

204

Posted on:

Tuesday 16th October 2012
View Replies!

data structures using array

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!!!!
VIEWS ON THIS POST

217

Posted on:

Tuesday 16th October 2012
View Replies!

executing code in the data segment

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 */ );
VIEWS ON THIS POST

198

Posted on:

Tuesday 16th October 2012
View Replies!

Writing data to a local text file

What is the easiest way to write data to a local text file (on the client PC) using an ASP page
VIEWS ON THIS POST

175

Posted on:

Tuesday 16th October 2012
View Replies!

ASP url Variable to insert database

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.\tThe url is appears like this /message.aspid=1 and I am assuming id has value assigned but does not insert into the database.\tCould anyone help me with this.\tI don't want use session variable since I already have two many of them
VIEWS ON THIS POST

194

Posted on:

Tuesday 16th October 2012
View Replies!

urgent! getting uniqueidentifier from database!

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:\t\t\t\t\t\tSet 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
VIEWS ON THIS POST

302

Posted on:

Tuesday 16th October 2012
View Replies!

Connecting to a mysql database and my SQL scripting help

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
VIEWS ON THIS POST

270

Posted on:

Tuesday 16th October 2012
View Replies!

show data user want to display?

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
VIEWS ON THIS POST

222

Posted on:

Tuesday 16th October 2012
View Replies!

How to put data back to ASP generated drop down list?

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 idea
VIEWS ON THIS POST

218

Posted on:

Tuesday 16th October 2012
View Replies!

how to export data to Excel?

,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..
VIEWS ON THIS POST

213

Posted on:

Tuesday 16th October 2012
View Replies!

Checking the database before submitting a form

Hi all,I have a form where the user can submit their e-mail address.\tBefore 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".\tI've been having alot of problems finding a good, clean way to do this
VIEWS ON THIS POST

207

Posted on:

Tuesday 16th October 2012
View Replies!

Using ASP to access remote SQL database

, Have a bit of a tricky one here, and wondering if anyone could help me out.\tThe problem involves allowing my ISP hosted ASP 3.0 pages to access and internal SQL server database.\tDoes 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).\tThis 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.\tAny ideas\tAny 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
VIEWS ON THIS POST

244

Posted on:

Tuesday 16th October 2012
View Replies!

Image upload - file system vs database

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 this
VIEWS ON THIS POST

256

Posted on:

Tuesday 16th October 2012
View Replies!

Using ASP for large (over 1GB) databases

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\t
VIEWS ON THIS POST

246

Posted on:

Tuesday 16th October 2012
View Replies!

asp pages and access database...

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 !!-----------------------------lee.gale@virgin.net
VIEWS ON THIS POST

243

Posted on:

Tuesday 16th October 2012
View Replies!

Passing an ASP variable to a database using SQL

I created an ASP page that will generate a random number.\tI have a variable set to catch the number.\tnow, 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").\tMy 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.\tI am hoping it is a syntax error.\tOh, I should mention that i am NOT a programmer by any means.....just trying to figure out a school project.
VIEWS ON THIS POST

200

Posted on:

Tuesday 16th October 2012
View Replies!

Sending input data via a link

Hi ,Is it possible to send input data via a link\tI am not talking about submitting the form.\tI want to add the values of the text boxes to a link.\tI've tried using the input name.Value, but keep getting a message something like "name" is not defined.\tIs there a way to do what I'm trying to do\tAny suggestions would be appreciated
VIEWS ON THIS POST

171

Posted on:

Tuesday 16th October 2012
View Replies!

Saving form data to database

HELLLLLLLLLLP!\tI 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.\tI can enter information into the webpage (www.automaxxmotors.com/creditapp.asp), 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
VIEWS ON THIS POST

212

Posted on:

Tuesday 16th October 2012
View Replies!