Download the image to the directory and database of the same form data

Hi all

I play to build a shopping cart (never done before) a tutorial of Gordon Knapp at www.webthang.com.

I created the site and it works perfectly. Now, I want to extend it.

There is a form that allows the user to add data to the database. I would also like to be able to transfer an image to a directory on the server and add the data to the database at the same time of the same shape. It would be good if the input field "< input name ="product_picture"type ="text"id ="product_picture"tabindex ="6"size ="50"/ >" could be filled automatically by the file name of the image being downloaded, but it's not a neccessity.

I looked at different packages ASP Upload and I can upload a single image, but none of them clearly show how to download the image and add data to the database at the same time.

It is a private project I need suggestions for free.

The tutorial shows how to create Dev Ultra site but works perfectly well in DW. The page looks like this. It is named "admin_add.asp":

"< %@LANGUAGE="VBSCRIPT "CODEPAGE ="65001"% >
"" <!-#include = file '... / Connections/con_ecom.asp "-->
< %
Dim MM_editAction
MM_editAction = CStr (Request.ServerVariables ("SCRIPT_NAME"))
If (Request.QueryString <>"") then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode (Request.QueryString)
End If

'boolean to abandon a record edition.
Dim MM_abortEdit
MM_abortEdit = false
% >
< %
"Implementation of the IIR.
Function MM_IIf (condition, ifTrue or ifFalse)
If condition = "" then
IfFalse = MM_IIf
On the other
IfTrue = MM_IIf
End If
End Function
% >
< %
If (CStr (Request ("MM_insert")) = "add_form") then
If (not MM_abortEdit) then
'execute the insert.
Dim MM_editCmd

Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_con_ecom_STRING
MM_editCmd.CommandText = "INSERT INTO products (product_category product_name, product_price, product_briefdesc, product_fulldesc, product_picture) VALUES (?,?,?,?,?,?)".
MM_editCmd.prepared = true
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param1", 202, 1, 50, Request.Form ("product_category")) ' adVarWChar
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param2", 202, 1, 50, Request.Form ("product_name")) ' adVarWChar
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param3", 5, 1, -1, MM_IIF (Request.Form ("product_price"), Request.Form ("product_price"), null)) ' adDouble
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param4", 203, 1, 536870910, Request.Form ("product_briefdesc")) ' adLongVarWChar
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param5", 203, 1, 536870910, Request.Form ("product_fulldesc")) ' adLongVarWChar
MM_editCmd.parameters.Append MM_editCmd.CreateParameter ("param6", 202, 1, 50, Request.Form ("product_picture")) ' adVarWChar
MM_editCmd.execute
MM_editCmd.ActiveConnection.close

' add the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "admin_control.asp".
If (Request.QueryString <>"") then
If (InStr (1, MM_editRedirectUrl, "?", vbTextCompare in) = 0) then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
On the other
MM_editRedirectUrl = MM_editRedirectUrl & "" & Request.QueryString
End If
End If
Response.Redirect (MM_editRedirectUrl)
End If
End If
% >
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN".
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ".
"< html xmlns =" http://www.w3.org/1999/xhtml "> "
< head >
< meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"
< title > Administration - add a < /title > product
"" < link href = "... / scripts/admin.css" rel = "stylesheet" type = "text/css" / >
"< script type =" text/javascript"src ="... / scripts/ecom.js "> < / script >"
< / head >

< body onLoad = "adminTitle ()" >
< div id = 'wrapper' >

< div id = "pageHeading" > ADMINISTRATION - add a PRODUCT < / div >

< div id = "navBar" > < a href = "admin_control.asp" > < /a > control | " Add | < a href = "admin_view.asp" > view < /a > | < a href = "admin_update1.asp" > update < /a > | < a href = "admin_delete1.asp" > delete < /a > | "" < a href = "... / Default.asp" > shop < /a > < / div >

< br / >

< name of the form = "add_form" id = "add_form" method = "POST" action = "< % = MM_editAction % >" >
< table border = "1" align = "center" id = "tblArea" >
< b >
< class td = "tdLabel" > < table > product category
< td colspan = "2" > < input name = "product_category" type = "text" id = "product_category" tabindex = "1" size = "50" / > < table >
< /tr >
< b >
< class td = "tdLabel" > Product Name < table >
< td colspan = "2" > < input name = 'product_name' type = 'text' id = 'product_name' tabindex = "2" size = "50" / > < table >
< /tr >
< b >
< class td = "tdLabel" > < table > product price
< class td = "tdContent" colspan = "2" > < input type = "text" name = "product_price" id = "product_price" tabindex = "3" size = "50" / > < table >
< /tr >
< b >
< class td = "tdLabel" > product short Description < table >
< class td = "tdContent" colspan = "2" > < textarea name = "product_briefdesc" id = "product_briefdesc" cols = "47" lines = "4" tabindex = "4" > < / textarea > < table >
< /tr >
< b >
< class td = "tdLabel" > full < table > Product Description
< class td = "tdContent" colspan = "2" > < textarea name = "product_fulldesc" id = "product_fulldesc" cols = "47" rows = "5" tabindex = "5" > < / textarea > < table >
< /tr >
< b >
< class td = "tdLabel" > < table > product Image file name
< class td = "tdContent" colspan = "2" > < input name = "product_picture" type = "text" id = "product_picture" tabindex = "6" size = "50" / > < table >
< /tr >
< b >
< class td = "tdLabel" > < table >
< td align = "center" > < input type = "reset" name = "Reset" id = "Reset" value = "Reset form" / > < table >
< td align = "center" > < input type = "submit" name = "Submit" id = "Submit" value = "Add to the shop" / > < table >
< /tr >
< /table >
< input type = "hidden" name = "MM_insert" value = "add_form" / >
< / make >

< / div >
< / body >
< / html >

Hope you can help.

Best regards

Martin

Have sorted it.

Found an excellent tutorial to Webthang.

http://www.webthang.co.UK/Tuts/tuts_dmx/rob15/rob15.asp

Tags: Dreamweaver

Similar Questions

  • Thunderbird is lock on a message and I have to delete the Bellsouth otherwise it will download the same email over and over. How can I fix it?

    It started a couple of weeks. I noticed an email several times being downloaded. After reviewing the many things, I deleted the email on Bellsouth and Thunderbird then downloaded all my emails. Over time, he started doing this several times in a batch of e-mails. The download bar will say it is loading down 1 (or whatever the number) to say 71 messages. It can download 1 or more, then it stops downloading. I go to Bellsouth and remove the last downloaded message and click Get Mail in Thunderbird to start the process again.

    If I don't delete the last email downloaded when I hit Get Mail Thunderbird will download the same email again and stop. A few times it will start a download and work for an extended period and then stop the download without having to download a single mail.

    Before I tried to pull up in protected mode I ran C Cleaner and SpyBot just to see if there was something I picked up somewhere. I've not seen anything unusual, but had two programs clean what they find. Since their execution I've seen Thunderbird download some e-mails twice, but it's the download now. Don't know what that programs cleaned up that seems to fix the problem. So, for the moment, it looks like I agree.

    Thanks Matt. If it comes up again I'll give the protected mode a shot.
    Jim

  • How do I download an image from a server and store it in EncodeImage

    How to download an image from a server and store it in EncodeImage?

    It allows you to create an EncodedImage object. so that you can upload an image from a server, you can use HttpConnection to send a request to your server. Then, your server can return the image file. Since he will cross the stream, you can read and store it in a "byteArray". so the ByteArray, you can generate an EncodedImage by calling the EncodedImage.createIncodedImage (byteArray). now that you already have a coded picture.

  • Thunderbird download the same message, off guard popstate.dat antivirus, renamed to old, still have the problem. Ready to upgrade to Outlook or another prog to mail.

    Read about other similar problems in the forum, tried the possible one - Disabled popstate.dat antivirus solution, renamed popstateold.dat, TB closed, reopened to he downloaded e-mails until the more recent with the problem and still trying to download it again and again. Can't download at the end, as refreshment shows always the same amount still on the server to download, even after downloading the same message several times. This has happened several times in the past months, with several duplicates, but not this loop continues. This is the second time in a week where this has happened. My first attempt to fix - I copied all the .msf files to the new location and uninstalled TB. Then reinstalled and back .msf files. He seemed to be ok for a few days, but now have the same issue. All windows updates to date, was updated to the most recent version of TB before it happens.

    Try to connect to your account via webmail and delete the problematic message.

  • Windows downloads the same updates.

    Original title: 01301

    Had a reputable computer store in a new hardrive in March. Since then, windows maintains daily updates download the same 4-2... has back to the store and they said it was fixed... no it's not.  ..

    How to troubleshoot Windows Update or Microsoft Update when you are repeatedly proposed an updated

    http://support.Microsoft.com/kb/910339

    Hide the Windows 7 updates that you don ' t Want never to install

    http://TechNet.Microsoft.com/en-us/magazine/ff382716.aspx

  • When downloading to the sd card how can I stop downloading the same pictures?

    When you transfer the pictures from my card how can I stop downloading the same pictures again?

    You can delete old photos to the SD card in the device or the computer.  You can also choose the option to select only the images you want.

    Good luck.

  • server-side and client on the same form-side code

    I CFINPUT text on the form and the form displays the control on the form when I use the preview browser.

    As long as I have CF tag which is the code on the server side that have no controls on the form.

    I thinkg I missed something when I have both control code and the server of the client on the same form.

    I would like to know how I can show the controls on the form and the CF tag for code running on the server side.

    For example, I have a user name and password text box on the form.

    I need to validate the information user and need of a stored procedure that is executed when the user clicks on the "connect" button.

    I have 2 text boxes on the form and it works.

    As soon as I have the CFSTOREDPROC tag then the shape does not shows the controls.

    It seems the form to run sider server code, but client side of the code does not run.

    Your information and help is much appreciated,

    Kind regards

    Iccsi,

    The form action attribute points to a different file or the same file? If it is different then you can not see the controls because it refers to another file (action file). If this is the same file, then it might have a logic that prevents the form to display after the form submission.

    It would be useful to join the code. So, we could myself or others help you better.

  • client code and server on the same form

    I CFINPUT text on the form and the form displays the control on the form when I use the preview browser.

    As long as I have CF tag which is the code on the server side that have no controls on the form.

    I thinkg I missed something when I have both control code and the server of the client on the same form.

    I would like to know how I can show the controls on the form and the CF tag for code running on the server side.

    For example, I have a user name and password text box on the form.

    I need to validate the information user and need of a stored procedure that is executed when the user clicks on the "connect" button.

    I have 2 text boxes on the form and it works.

    As soon as I have the CFSTOREDPROC tag then the shape does not shows the controls.

    It seems the form to run sider server code, but client side of the code does not run.

    Your information and help is much appreciated,

    Kind regards

    Iccsi,

    Thanks for the information and assistance,

    I have a fault of typo on my SQL statement,

    Kind regards

    Iccsi

  • I want to export data from a scanned online in the same form in my printer form

    I want to export data from a scanned online in the same form in my printer form

    Something digital is an image. A picture in itself has no data. It's just the picture of things.

    Thus, you can not export or transfer, what is not there.

    Be well...

  • Different version of the same form

    I have 3 different versions of the same form that I need to turn it into editable PDF files. Each form has the same fields, placed in the same place, however the logo and the language is different on PDF files. I already have a modifiable form and it was VERY time consuming, there are a lot of fields and check boxes throughout the document.

    Is it possible to copy and paste (drag / move) the editable fields from the form for the 2 other versions? Or do I have to create fields of each on individually? One took me several hours to complete, and I'm not anxious to do this 2 more times.

    For any help or suggestion would be greatly appreciated!

    All you have to do is to open the document that contains the fields, and then select "Document > replace Pages" for updating the content of the underlying page with pages to a new document that you created in the other language. The fields, links, etc will be kept.

  • How to select the same forms of color in the adobe flash program?

    How to select the same forms of color in the adobe flash program? for example, we assume that 10 forms of rectangle. 3 of them are red and others are green. I want to use only one method or click to select 3 of them. Please help me

    Thanks kunter

    You can use Ctrl + F.

  • Image #103981799 does not download the same file than what is displayed in the preview. How can I get a refund on the image credit?

    It takes the silhouettes of the forest, but it downloads a file o a branch be with birds on it.

    https://stock.Adobe.com/stock-photo/forest-silhouette/103981799

    I can confirm the issue, Sheena. Seems to be OK until it register you. It shows even correct in the libraries Panel, but as soon as you open the file it certainly does not come to the top with the same file. It; t happens once it is authorized. Before she was allowed it worked fine. You can see in the screenshot below the thumbnail in the library panel is correct but the image open in Illustrator is false.

  • with MS XP, when I shut down the computer, try to download the same update again and again!

    and I don't know how to find the updated info?  Help!  It takes 5-10 minutes every time I have shut down the computer.  How to cancel this update which blocks my crt?

    Thank you!

    Julie

    Hi jjackbcop,

    Thanks for posting in the Microsoft Community.

    I understand that you are facing the issue with windows updates offer several times over and over again.

    Method 1:

    I suggest you perform the clean boot and check.

    Place the computer in a clean boot state, then check if it helps. You can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note: After completing the steps in the clean boot troubleshooting, follow these steps to configure Windows to use a Normal startup of the link report section to return the computer to a Normal startup mode.

    After the clean boot used to resolve the problem, you can follow these steps to configure Windows XP to start normally.

    (a) click Start, run.

    (b) type msconfig and click OK.

    (c) the System Configuration Utility dialog box appears.

    (d) click the general tab, click Normal Startup - load all services and device drivers and then click OK.

    (e) when you are prompted, click on restart to restart the computer.

    Method 2:

    I suggest you send the link and check (this also applies to windows XP).

    Windows Update or Microsoft Update repeatedly offers the same update

    https://support.Microsoft.com/kb/910339

  • I can't download the Visual form photo my camera to my pc

    I need help. The image is available for download but not the video images.  Why?

    I need help. The image is available for download but not the video images.  Why?

    ======================================
    Something to try...

    Connect your camera to the computer via a USB cable or insert
    your memory in your card reader and close all
    Windows that can be opened... then try the following steps.

    If you connect the device to your PC via a USB cable, turn
    on the camera... then go to... Start / computer... it can be
    listed as a drive letter...

    If_yes_right click on the drive letter and select... Explorer or
    Open... This should display the directory of the memory card.
    You can copy and paste or drag and drop the files from there to a
    folder on your hard drive.

    The same steps will work if you have a media player...
    When you go to... Start / computer... the card reader must
    be recognized as one or more hard drives.

    Removable (e :)) drive
    Removable disk (e :))
    Removable drive (g)

    If_Yes_you can download the files from here. Left click
    the drive letter that corresponds to the location of your memory
    a card should display the directory of the card and you
    can copy and paste or drag and drop the files of your choice for a
    folder on your hard drive.

    Just right click a file or group selected (hioghlighted)
    file and choose... Copy... then navigate to the folder that you
    want to save them in and right-click on the folder and choose Paste.

  • Not able to download the Program Guide data

    I'm having the same problem. I use Windows 7 Professional x 64 and have a wired connection to the internet. I can not get the MC to download an update for the guide.

    In the activity log event ID is '0 '. Here are additional details contained in the message window.

    Journal name: Media Center
    Source: MCUpdate
    Date: 2010-02-18 09:12:51
    Event ID: 0
    Task category: no
    Level: Information
    Keywords: Classic
    User: n/a
    Computer: WJH-ZT-PC
    Description:
    09:12:35 - the package directory is already updated.
    09:12:35 - ClientUpdate the package is already up-to-date.
    09:12:35 - NetTV package is already up-to-date.
    09:12:35 - MCESpotlight the package is already up-to-date.
    09:12:35 - MCEClientUX the package is already up-to-date.
    09:12:35 - SportsSchedule the package is already up-to-date.
    09:12:35 - SportsV2 the package is already up-to-date.
    09:12:35 - The Broadband package is already up-to-date.
    09:12:35 - MCEClientMaintenance the package is already up-to-date.
    09:12:35 - NetworkMetadata the package is not available.
    09:12:35 - test of internet connection.
    09:12:35 - connection is established.
    09:12:36 - recovery EpgListings.
    09:12:36 - EpgListings treatment.
    09:12:36 - EpgListing - 8.enc recovery.
    09:12:40 - 28514937_ListingData.mxf extraction.
    09:12:40 - 28514937_ListingData.mxf treatment.
    09:12:51 - errors during the last update.
    09:12:51 - retries at 2010-02-19 12:35:01 AM.

    Any ideas what the problem is and how it can be fixed?

    So, I finally got the guide to download. I don't know why he picked up, and I don't know why it stopped working in the first place. It is the sequence of steps that brought her to life.

    Synchronize the PC with the time clock Internet.
    Disable Media Center & reboot.
    Activate the functionality Media Center and restart.
    Run the Media Center Setup from scratch.
    Open a window (as administrator) command prompt and run mcupdate with the parameter - uf (start/wait mcupdate %windir%\ehome /d - uf).
    Mcupdate lasted several minutes and finally crashed with a message that the update process could not continue. On the taskbar, the icon Mcupdate said he was "Starting Client Update".
    Mcupdate restarted itself and ran until she has yet.
    This repeated 4 or 5 times and I finally have it canceled since the Task Manager.
    Opened the Media Center and started the update of the Guide from there.
    A message popped up indicating that the guide was a problem with the client.
    Revived the update of the guide and it is finally completed successfully.
    Close the Media Center client and reopen it. The Guide seems perfect.

    All is now well with the Media Center client. However, I don't know why, or if it will start still hesitated to more downloads. Perhaps documenting this sequence of steps will help others. Maybe Microsoft can use this information to help solve this bug in Windows 7 and release a patch.

Maybe you are looking for