Upload Images using .ASP and MS Access (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


bige -> Upload Images using .ASP and MS Access (1/8/2004 0:15:29)

Hello all,
I need to be able to have users upload images as well as put in product information contact name etc and then be able to write that information to an Access database using the Options "send to database" in FrontPage. I have the database working but I read that in order to use the file upload you have to use htm instead of asp. So how do I combine the two. I need to store images in the database and then be able to pull them up when searching through catagories.

Any suggestions?

Thanks
Michael




bige -> RE: Upload Images using .ASP and MS Access (1/8/2004 1:01:15)

I tried the following:

I created a page called upload.htm and added a form then inserted the file upload to that page. The in form properties I told it to post to products.asp page. On the Products.asp page is where I collect all of my data and store it to the database after clicking submit. I told it to have a hidden field of "Image" with a value of <%=request.form("Image")%> hoping that it would capture the path from the htm and then add that path to the database. no such luck however.




Googly -> RE: Upload Images using .ASP and MS Access (1/8/2004 15:12:09)

bige,

When you post the image and attempt to store it in the database the field in the database must be set as "OLE Object" and there is other information that needs to be entered (i.e file size, data type etc). I have not yet been able to post binary data to a DB using the FP Form wizard....however.......
At the risk of sending anyone off on a non-FP solution, this is a compilation of forms that I have used successfully to add binary data (JPG's, PDF's etc) to an Access database along with username, password, contact info etc. I'm not sure how ASP Saavy you are but this set of scripts is easily "Personalized" for the mid-line and above users: You can also integrate the script code into your FP generated posting forms and carry out multiple database operations on the same "Updte" page.
My apologies to the moderator for posting another's site here:

http://www.stardeveloper.com/articles/display.html?article=2001033101&page=1

If you have to stick to the FP Database From wizard then your next best alternative is to create a writeable directory in your web and use the FP Upload component to dump the file there. Alot of ISP's don't allow write access to the general public so it may be difficult to allow "everyone" the ability to upload an image. (not to mention space wasting for your web dir!).

I hope I didn't confuse you more! Good luck with it!




bige -> RE: Upload Images using .ASP and MS Access (1/8/2004 15:46:19)

Thanks a bunch Googly... It looks pretty comprehensive. I will give it a shot and let you know how it turns out.

Michael[:)]




Spooky -> RE: Upload Images using .ASP and MS Access (1/9/2004 7:19:14)

Youll find a reference to the FAQ in this forum too - I always recommend uploading a file reference to the database (text) and storing the blob in a folder.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.298828E-02