Upload file to SQL database using classic ASP

I'm trying to upload files (.doc / .pdf) to an SQL database (2005), but I'm really trying to find any walkthroughs.

This is what happens in my ASP form:

  • User selects a document
  • The document is currently being downloaded to a temporary file and sent to the email address

However, it must also be stored in the database field.

I set the field type in the database for the image. But I'm not sure how to save binary data when all I have is a link to a document (e.g. C: //) from the user.

I also want to download this document later, is it also possible?

Thanks in advance for any help.

Thanks Claire

+3
source share
8 answers

As mentioned earlier, storing binary data in a database is usually not a good idea.

Wouldn't it be enough to store the file on disk, where document id / PK becomes the file name and stores only the file name / id, the original file name and file description in the database?

This will solve most of your problems:

  • Save / generate links to documents in a simple way.

  • Easy download (just a link to a file on disk).

It also prevents problems with the rapidly growing database size and the writing and support of additional code for storing, searching and maintaining documents stored in the database.

If you really only need a link to a document, this is, in my opinion, the best solution.

- VB6 Microsoft, -.

, ( , ), , .

!

+2

, freeaspupload . . , , , db. - , . , .

+2

( , , .)

ASP , . , , , .

+1

ASP , ASPUpload, 200 . -, , , , ASP, .

2001-2005 , .. ASP. , . .

+1

ASP" CodeProject . . .

, , .

+1

FreeASPUpload .
, SQL , . , , .

0

ASP , , ASP, . , , - , 2001 . , - (, -, - Sagasnet). , , . , .

0

Here is a link that shows you how to upload files to the database. It works for me, now I just need to figure out how to get it.

link text

0
source

Source: https://habr.com/ru/post/1704828/


All Articles