Forum Moderators: open

Message Too Old, No Replies

image upload and resize in asp?

need free script for a non-profit

         

amznVibe

8:07 am on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know very little about asp since I deal only in the apache/php world, but I am trying to help a 501.c3 update some of their webpages, that are done on a IIs/asp server. One thing they want to add is the ability to have their volunteers upload a headshot so they can have a little database of folks.

I've found two dozen commercial scripts, but unlike the php world, I cannot seem to find a single free script (that doesn't need 3rd party solutions).

Any help is greatly appreciated, thank you...

lazerzubb

8:17 am on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>I cannot seem to find a single free script (that doesn't need 3rd party solutions).

Never found it, if you actually want to resize the picture, so it becomes small in actual filesize.

There is a bunch of scripts which uploads the picture, and resizes it, but the filesize will be the same.

amznVibe

4:08 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So you are saying it just changes the height and width tags?
Well I guess that's a start... I can manually resize the images once in a while.

Where would I find the free image upload script(s)?

macrost

7:14 am on Aug 23, 2003 (gmt 0)

10+ Year Member



amznVibe,
Well first off, it depends on if you are running access or sql server as your database. If you are running access, I wholly recommend you not storing binary data in that, as it will become very bloated. The best solution with that is to just store the image path. As for asp upload scripts, I can't think of any off hand that are free and don't require a .dll to be installed.

Mac

amznVibe

1:09 pm on Aug 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I did some looking around and I found some free vbscript based stuff that might work on their IIs server. If anyone needs something like this in the future, stickymail me and I'll send you the urls I got this from.

Still accepting other sources/ideas if anyone comes up with some. Thanks!

mahaleleel

3:02 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



I have not tried any of the methods of file upload on this page, but it has multiple options so if one doesn't work you can try another one:

[asp101.com...]

asp101 [asp101.com] itself is a pretty good resource and searchable.

If you have a little money to put into it my company uses and I have used SoftArtisan's FileUp. You can get it for around $300. It works great and the code is incredibly simple. Here's the link for that:

[fileup.softartisans.com...]

RossWal

4:41 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



I've heard good things about aspUpload. Also, .net makes uploads very easy to code.

aspdaddy

4:45 pm on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am having a problem with aspupload after applying service packs. You have to use the :

objUpload.Login method to write a file to the server, which needs a win2k user account.

Mechaworx

11:22 pm on Sep 2, 2003 (gmt 0)

10+ Year Member



I've heard good things about aspUpload. Also, .net makes uploads very easy to code.

Yes, I like AspUpload myself. I use it to upload image files to my server.

They also have a thumbnail live demo that lets you take images off your computer, upload them to a directory on your server and resize them with the end result that the thumbnail displays in the browser. I suppose you can right-click on it save it then upload that. The name of this is ASPJpeg and they have a live demo and they let you download the code for free to fool around with. I don't know if I can post the url so I won't but if you want it just email me.

I did have a problem with it however, When I tried to use it on my server, I could not get the thumbnail to display in my brower after the changes were made. Is this because I don't have a special component installed on my server?

Gerry

davemarks

8:19 pm on Sep 3, 2003 (gmt 0)

10+ Year Member



ASPUpload and ASPJpeg in tandom will let you upload a file, resize, compress, add copyright and other stuff and then let you save it to disk.

Both are not free, and both require being installed on the server, but are well worth it as they are great little progs to have!

Mechaworx

8:45 pm on Sep 3, 2003 (gmt 0)

10+ Year Member



ASPUpload and ASPJpeg in tandom will let you upload a file, resize, compress, add copyright and other stuff and then let you save it to disk.
Both are not free, and both require being installed on the server, but are well worth it as they are great little progs to have!

Ah, I do not have access to the server. Will I have to have my ISP install ASPJpeg component? ASPUpload works for me ie; I can upload images to my remote server into a pre-determined directory where my site is located but I can't get ASPJpeg to display the thumbnail in the browser, is my ISP missing this component hence no thumbnail display? The code works fine.

Gerry

davemarks

2:56 pm on Sep 4, 2003 (gmt 0)

10+ Year Member



Thats probably the problem... I know when i hosted with a third company they had ASPUpload but not ASPJpeg

You should be able to tell by the error the script throws out. I trust you have friendly error messages turned off ;)

Mechaworx

4:00 pm on Sep 4, 2003 (gmt 0)

10+ Year Member



No, it actually doesn't give an error what happens is It runs through the script then when it's time to display the new thumbnail in the browser it just displays the proverbial small box with the "X" in it.

Yes I do have friendly messages turned off.

I got this script that detects the server components installed on my server and I think ASPJpeg isn't installed:

Detecting Components:

NOT FOUND: Smart Image Processor Own component
NOT FOUND: ASPJpeg Server Component
FOUND: ASPImage Server Component
NOT FOUND: ASPSmartImage Server Component
NOT FOUND: ImgWriter Server Component
NOT FOUND: AspThumb Server Component
NOT FOUND: ASP.NET Server Component

Gerry

Small Website Guy

2:47 am on Sep 5, 2003 (gmt 0)

10+ Year Member



File uploading is built into ASP.NET and image resizing is built into the .NET framework. You don't need to use any third party controls or anything to do this.

You can also save images as JPEGs and determine exactly what how much compression to use. You can choose linear or bicupic resizing, and high or low quality.

System.Drawing contains all the functionality to work with images.

Of course, it's very poorly documented in the official Microsoft documentation :(

Also, don't store images in a database, store the file on the server, and store the location of the file in the database.

Mechaworx

6:43 am on Sep 5, 2003 (gmt 0)

10+ Year Member



Also, don't store images in a database, store the file on the server, and store the location of the file in the database

I think that is what we were talking about. Eventually, I'd like to use the thumbnail re-sizing script as part of a form that allows my users to upload images using ASPupload then create thumbnails using ASPJpeg.

Eventually the information ie; path to the image files thumbnails and original Jpeg file will be put into a database. But for some reason, using ASPJpeg script won't display the completed thumbnail in my browser.

I think it's because I do indeed need that ASPJpeg server component that's not on my server. If there is another way around doing this please let me know.

Gerry

aspdaddy

8:12 am on Sep 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know a file upload can be done without a component using vbScript binary read etc- albeit not very efficiently, does anyone know if this image resizng stuff can be done in script?

davemarks

9:52 am on Sep 5, 2003 (gmt 0)

10+ Year Member



Maybe it would be worth taking a look to see what ASPImage does...

I'm surprised it doesn't give an error, and would very much expect it too, as I have had errors when i have first installed my dev server and forgetting to install the coms, and again when the license has run out...

Small Website Guy

3:56 am on Sep 7, 2003 (gmt 0)

10+ Year Member



Like I said before, you don't need a third party product to do what you want to do, it's all in the .NET framework's System.Drawing area. I have it working on my website, and it's been performing just perfectly. (Alas, I can't get anyone to visit my website, but I have the ASP.NET stuff working really well.)

It's not documented very well in the MSDN, but if you search the web you can find some code samples that will help you figure it out.

aspdesigner

7:17 am on Sep 7, 2003 (gmt 0)

10+ Year Member



amznVibe, be cautious with some of the "free" file upload scripts out there. One of the "gotchas" is that different browsers and environments (IE, Netscape, Mac, etc), each handle multipart/form-data in a slightly different fashion, a good upload script has to take these browser peculiarities into account. Most of the free scripts out there do not.

As far as resizing the graphics files a la "Photoshop" on the fly from a classic ASP server is concerned, this would involve binary read & write to the file, interpreting the internal file format of the JPG files (including reading and decompressing the actual images), and some fairly intense graphics programming. Even as a custom component, it's likely more cost effective to simply get something off-the-shelf, rather than to try to code this yourself, particularly for a non-profit.

jwrog

8:29 pm on Sep 24, 2003 (gmt 0)

10+ Year Member



Since we are discussing file uploading and resizing, if only a URL is provided, can a web server "download" a file and store it in a folder on the web server so that its file properties can be determined and ultimately resized into a thumbnail? I believe this is exactly what Amazon does when new product listings are posted, and URL's are provded instead of actually uploading the files. I just have no clue how to do this.

Xoc

9:05 pm on Sep 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To upload a file:

On the asp.net form, make the html look like this:

<form id="Form1" method="post" enctype="multipart/form-data" runat="server">
<input id="inpAttach" type="file" runat="server">&nbsp;<asp:button id="btnAttach" runat="server" text="Attach" cssclass="button"></asp:button>
</form>

On the click event for the button, put some code like this (VB.NET code, similar code works in C#):

Private Sub btnAttach_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnAttach.Click
If inpAttach.PostedFile.FileName.Trim().Length > 0 Then
drAttach.strDescription = System.IO.Path.GetFileName(inpAttach.PostedFile.FileName)
Dim abyte(inpAttach.PostedFile.ContentLength - 1) As Byte
inpAttach.PostedFile.InputStream.Read(abyte, 0, inpAttach.PostedFile.ContentLength)
'Do something with the contents of the file in abyte.
End If
End Sub

The contents of the file in abyte can then be written to a file or a database field, or whatever.

To display the picture is more difficult.

jwrog

9:12 pm on Sep 24, 2003 (gmt 0)

10+ Year Member



Thanks much!

You lost me with the displaying of the file being tricky. If this code you specified downloads the file to the server, why then would displaying it be tricky? Did you mean the resize part of this would be tricky?

Also, is their an ASP solution rather than an asp.net solution available?

davemarks

2:59 pm on Sep 25, 2003 (gmt 0)

10+ Year Member



Go to www.futurestore.co.uk and download a trial of their aenovo content management system.

In their you'll find image upload stuff written entirely in ASP Classic.

You may need to check the copyright though, but I'm sure they wouldn't mind you taking a peek to see how its done - i mean they're giving away a crippled version free anyway...

talon121

1:08 am on Oct 1, 2003 (gmt 0)



I've got a similiar senario.

For non-profit as well.

This is what needs to happen.

I have an admin page that uploads to a blob field whatever image, but Im running into a problem.

Thumbnail creation from SQL Blob. (without just using the <IMG> tag for this.. I need to physically create or 'response.binarywrite' the thumbnail to minimalize size on the hd.

I have not found ANY free solutions for this.

Anyone have any information or anything recent? I've been using ASP.Net as the method of upload, although I can easily change to classic ASP, just need a single way it'll work. Its just the thumbnail that I'm concerned with getting into blob format.

Anyone recommend anything?

Thanks!

Jason
'big asp guy'

Xoc

7:06 pm on Oct 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I posted an article here: [webmasterworld.com...] showing how to create thumbnails in asp.net.

rc1ark

7:13 pm on Nov 7, 2003 (gmt 0)



Check this link for a great way to manipulate images on the server:
[vimas.com ]

Hope this helps!
~Ruben Clark