Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 592
  • Last Modified:

ASP - Upload Files - MySql Blob

I am trying to find out what is the best method on Uploading Images (up to 3) from Classic ASP.  Then have them be stored in a MySql Blob.  Then I will show them in a results page... but that is later.  Any pointers?  My site is being hosted on Godaddy.
0
vbjohn
Asked:
vbjohn
  • 4
  • 4
1 Solution
 
vbjohnAuthor Commented:
BTW:
I have the database as:
Table = Property
fields = pImage1, pImage2, pImage3
0
 
R_HarrisonCommented:
The best option is to find out what components GoDaddy has installed - e.g ABCUpload, etc... If they have a component installed then it should be fairly easy and straightforward.   If not, then you will need to look at using a PureASP upload function.
0
 
vbjohnAuthor Commented:
ASPUpload
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
R_HarrisonCommented:
Take a look at,

http://www.aspupload.com/manual_memory.html

Here you will find example code to do what you are after as well as the full manual for aspupload.
0
 
vbjohnAuthor Commented:
That link did not tell me anything.
0
 
R_HarrisonCommented:
OK, will try and paste you some code shortly...
0
 
R_HarrisonCommented:
Below is the code for 2 pages.   Make sure your FORM ACTION points to the database page that you create.

I don't have ASPUPLOAD so I can't test it, but according to the manual this should work, but let me know if you have any problems.
///  THE CODE BELOW IS FOR THE FORM PAGE ////
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="DatabasePage.asp">
Select file: <INPUT TYPE="FILE" SIZE="40" NAME="FILE1"><BR>
Select file: <INPUT TYPE="FILE" SIZE="40" NAME="FILE2"><BR>
Select file: <INPUT TYPE="FILE" SIZE="40" NAME="FILE3"><BR>
<INPUT TYPE=SUBMIT VALUE="Upload!">
</FORM>
 
 
 
///  THE CODE BELOW IS FOR THE DATABASE HANDLING PAGE ////
<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save
 
// ADD YOUR DATABASE CONNECTION STRING HERE
rs.Open "Property", Connect, 2, 3
rs.AddNew
Set File = Upload.Files("FILE1")
If Not File Is Nothing Then	rs("pImage1").Value = File.Binary
Set File = Upload.Files("FILE2")
If Not File Is Nothing Then	rs("pImage2").Value = File.Binary
Set File = Upload.Files("FILE3")
If Not File Is Nothing Then	rs("pImage3").Value = File.Binary
rs.Update
// CLOSE DATABASE CONNECTION HERE
%>

Open in new window

0
 
vbjohnAuthor Commented:
Thanks for the help.  We went a different route.  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now