|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP Image Upload
Okey, here we go.
Some days ago I was asked if I could create an image upload for a very big homepag, it was an offer I coudln't resist. Though I'm normally using PHP I learnt quite a lot of things now, and understand the language. But still, I don't know how to create this image upload, I've googled a lot and checked different scripts, including freeaspupload.net and similar things. Of course I can't take copyrighted source and just put it in, I think that's quite "low". So I'm trying to create an own script, by looking at other scripts and see what does what. Though I can't seem to find a working solution, for example I've not seen a function to check if the file that's submitted through a html form is an image. I would really appreciate if someone could show me the basics of an image upload. It seems that a lot more coding is required for ASP than for PHP, but then again, I might do it the wrong way. |
|
#2
|
|||
|
|||
|
Hey there! Yea, PHP is a world easier to do with file uploads compared to ASP. I'm going to assume that you are doing this with plain ASP. I've actually got the code for this. The thing is, to do file uploads in plain ASP, you gotta use ASPUpload (http://aspupload.com/). That link will take you to there home page. Secondly, here's the code you're gonna have to use. If you're still confused, stuck or want to give mad props to me
just postAight man, best of luck to ya'. I feel yer pain. The code: Code:
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
On Error Resume Next
Upload.SetMaxSize 1048576 ' Limit files to 1MB
Count = Upload.Save(Server.MapPath("/images/avatars/"))
Set File = Upload.Files(1)
For each File in Upload.Files
'--- determine which image it is and locate properly
Select case File.Name
case "picture"
'picture is the name of the file input from the form this was submitted from
picture = File.ExtractFileName
End Select
Next
%>
|
|
#3
|
|||
|
|||
|
Ok, thanks for answering!
Bad news for me, but at least I know what I gotta do now! |
|
#4
|
|||
|
|||
|
I don't know if asp.net is an option for you, but here is a great tutorial for uploading an image...
http://www.stardeveloper.com/articl...03031201&page=1 If you decide to go with ASP.NET you could use this to code in, rather than shelling out the big bucks for Visual Studio: http://www.asp.net/Default.aspx?tabindex=0&tabid=1 Last edited by DrewPeterson89 : June 14th, 2005 at 05:56 PM. |
|
#5
|
|||
|
|||
|
ASP.NET isn't a possibility for me (
), but thanks for answering. Also there were a upload using plain asp at the page you gave me, very useful, thanks. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > ASP Image Upload |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|