Link to home
Start Free TrialLog in
Avatar of elevatedmarketing
elevatedmarketing

asked on

ASPSmartUpload is driving me CRAZY!

Hello all.  I'm new to ASP programming and have been dealing with this for 2 weeks and need some help.  I need to create a back-end user interface for a client to add articles and images AND/OR articles and MP3s to his site.  Our hosting company supposedly has ASPSmartUpload installed (at least they say they do!).  I have struggled for 2 weeks to try to use it to no avail.  I know you are going to point me to their documentation at www.aspsmart.com --believe me, I've been there hundreds to times trying to figure this thing out and cannot.  Is there a "step-by-step" tutorial or guide out there to use ASPSmartUpload?  I know the problem is on my end, but I need help badly!

Sincerely,
Adam
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

Avatar of elevatedmarketing
elevatedmarketing

ASKER

I've tried it, I get an HTTP 500 Server Error.
Okay good!

Please try doing this:

In IE:

Tools Menu --> Internet Options -->Advanced Tab-->Show Friendly HTTP Error Messages

The last item should be unchecked.

Try that and then re run your page.

FtB
THis is what I get back...


aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 31


Here is Line 31:    

file.SaveAs(filename)

By the way, I already feel like we're getting somewhere...
That's good!

Would you please post the whole page of code so that I can take a look? Also, are you certain that you set the form type to multipart/form-data like this:

<FORM METHOD="POST" ACTION="upload.asp" ENCTYPE="multipart/form-data">

I know this is cheesy, but I copied the code from the page you suggested.   I'm the copy and paste king...  But here's my code.

*************************************

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 50000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload

' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
' Add a session number to the file name
  filename="../upload/" &session.sessionID & "_" & file.FileName

  file.SaveAs(filename)

  intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

************************************

Thanks for your help so far!

Adam
Okay, the good news is that if you got as far as line 31, then the Upload component is installed.

What happens if you change this line:

  filename="../upload/" &session.sessionID & "_" & file.FileName


to this:

  filename= session.sessionID & "_" & file.FileName

FtB
Glad to know ASPSmartUpload's installed...

Make the suggested change and still the same error message, same line.

Adam
Sounds like permissions problem!  Do you (IUSR account) have permission to write to that directory?
Okay, let's comment the line out altogether, like this with an apostrophe at the start of the line:

'filename="../upload/" &session.sessionID & "_" & file.FileName


FtB
which directory should I modify in my hosting control panel?  the whole thing?
@alorentz--

It is pointing to the root directory right now.

FtB
OK.  Making progress...

Now the Error is:

aspSmartUpload.File error '80040474'

The destination must be specified (Error 1140)

/asp/upload.asp, line 31


_______________________________

Also, just so you know, line 31 is the following line:

  file.SaveAs(filename)

NOT
filename="../upload/" &session.sessionID & "_" & file.FileName

Maybe no permissions to add files at all anywhere...?  Have to talk to Host about that.
Sorry, I am being a bozo!!

Let's not comment out the line, but make it like this:

 filename= file.FileName

FtB

Same error message...

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 31
According to this:

http://www.aspsmart.com/scripts/aspSmartUpload/publigen/content/templates/show.asp?P=267&L=EN

it may indeed be a permissions issue like alorentz suggested.

In order for this to work, the IUSR_ and IWAM_ accounts must have READ/WRITE permissions to the directory.

If you don't know how to do this yourself, or do not have the means to do this, contact your hosting company and tell them what is needed.

See also:

http://p2p.wrox.com/topic.asp?TOPIC_ID=13417

FtB
One other thing to try in case this is a path issue:



filename= Server.MapPath(".\") & file.FileName
OK.  That did something because this is the message I'm getting now...

aspSmartUpload.File error '80040451'

Size exceeded for this file : '\cross.jpg' (Error 1105)

/asp/upload.asp, line 23
Oh, that is very good news!

That means that the file is too big!

Please try a small file, and if that works, I'll show you how to increase the allowed size.

FtB
These lines limit the upload to 50k:

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 50000


To change that, just adjust the number to something higher:

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000


FtB
Okay, so I have provided a step by step sample as requested, figured out why the code was crashing (it was a path issue) and then provided a fix for that. Unless I am mistaken, once you change the file size property, that should remove your final error.

Fritz the Blank
Fritz, I don't know what has happened, but it's reverted back to the old Error.  I've redone what we just went through and now I can't get that one error about file size back.  Here's the code I have now.  Please advise and the points are yours!  (I kindof feel like Santa Claus!)
**************************

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 50000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload

' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
' Add a session number to the file name
filename= Server.MapPath(".\") & file.FileName
       
  file.SaveAs(filename)

  intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

********************************

Did I miss something?
What is the error and line number? Also, what size of file were you uploading?

FtB
THe Error is:

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 31


The file is 4.07 Kb.
But also, when I try to upload a file too big, I get this (I've not changed the ASP page):

aspSmartUpload.File error '80040451'

Size exceeded for this file : '\cross.jpg' (Error 1105)

/asp/upload.asp, line 23
Okay, try this:

For each file in mySmartUpload.Files
 If not File.IsMissing then
' Add a session number to the file name
filename= Server.MapPath(".\") & file.FileName
  response.write(finename & "<P>")
  response.end    
  file.SaveAs(filename)

  intCount = intCount + 1
 End If
Next
OK.  That did something.  No error page now, but it just went to a blank screen.  Plus I looked on my site and the file is not on my server.
Sorry,I had a typo there. That should be:

For each file in mySmartUpload.Files
 If not File.IsMissing then
' Add a session number to the file name
filename= Server.MapPath(".\") & file.FileName
  response.write(filename & "<P>")
  response.end    
  file.SaveAs(filename)

  intCount = intCount + 1
 End If
Next


OK.  Now this is what I got:

C:\Accounts\elevated\wwwRoot\aspalaskabike.jpg

Looked on my server and nothing there.

I feel we're right on the verge of something great here!
Okay, that looks about right. Next modification:

For each file in mySmartUpload.Files
 If not File.IsMissing then
' Add a session number to the file name
filename= Server.MapPath(".\") & session.sessionID &"_" & file.FileName
  response.write(filename & "<P>")
  response.end    
  file.SaveAs(filename)

  intCount = intCount + 1
 End If
Next
OK.  Now I got:

C:\Accounts\elevated\wwwRoot\asp1035689867_alaskabike.jpg
Okay, one last stop:

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
      ' Add a session number to the file name
      filename= Server.MapPath(".\") & session.sessionID & "_" & file.FileName
      file.SaveAs(filename)
      intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>
Back to the old error message:

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 29


For clarification, I just cut and pasted your last code as my asp page.  That was right, right?
You have done everything correctly.

The whole point of the last few posts was to ensure that you had a proper path specified, that the name of the file was making it, that it had a unique name and etc. and etc. These tests show that everything is as it should be.

This definitely appears to be a permissions issue, so you will have to follow up with your hosting service. Explain to them that the IUSR_ and IWAM_ accounts need to have Read/Write permissions to this directory.

FtB
I've submitted the ticket to them and I'll get back to you ASAP.  Thanks for all your help!  I look forward to giving you those points.

Should I revert back to the previous version of the ASP page for is the whole page post you posted 3 posts ok to serve as my code?
Please stay with the most recent version. The tests that we performed above show that everything is as it should be.

FtB
I'm on with TS at my hosting company.  Hope to get this resolved ASAP.

Adam
OK.  TS was able to isolate the issue and get it fixed.  This is the final ASP Upload code that works:

________________________________________
<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
     filename= Server.MapPath(".\") & "\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

_______________________________________________________

Now 2 things:

1.  the files are being uploaded to the rootdirectory and not my directory called "uploads".  How do I change that?

2.  on the following page "asplook.asp"  the image will not display.  Here's the code:

_________________________



<HTML>
<BODY BGCOLOR="white">
<%
if IsEmpty(request.querystring("msg")) then
%>
<img src="<%=request.querystring("file")%>">
<%
else
%>
<%=request.querystring("msg")%>
<%
end if
%>
</BODY>
</HTML>

_____________________________________

Thanks!
See told ya it was permissions :)

Good luck!
I am not sure that I see what the difference is. Did they say it was a  permissions issue or did they change anything in the code?

About your remaining questions:

1) Do you actually have a directory named uploads in your web root?
2) there is no image tag here: <%=request.querystring("msg")%>

FtB
If you are sure that you have a directory named uploads off of your root, then just do:

filename= Server.MapPath(".\") & "\Uploads\" & file.FileName


FtB
If you need assistance closing this question, please let me know...thanks.
Well, the did change the code a bit in the Server Map Path--but that may have been a smoke screen for not being able to change the permissions as quickly as they should have...

I do have a directory named uploads.  I made the suggested changes, putting in the "\uploads\" command, but still get the same error as eariler.  

What I'm also wanting it to do is return the http: address where that image just uploaded can be found, and also the image that was just uploaded.
Okay, we need to stay focused and deal with the most pressing issue at hand. If you have a series of other questions, perhaps you can post them in separate threads.

This is what I had:

filename= Server.MapPath(".\") & session.sessionID & "_" & file.FileName

This is in your new code:

filename= Server.MapPath(".\") & "\" & file.FileName

The difference here is that what I have will uniquely name each file. That way, if two users try to upload a file with the same name, one won't overwrite the other.

Now, you are telling me that you have a directory named uploads? As a test, put an image in that directory, and then tell me what you have to put in the URL to see it.

FtB
http://www.elevatedmarketing.com/asp/uploads/naples.jpg  (this is where I want the files to be uploaded to and have this same link returned for later entry into a database.

I'm not worried about other users uploading same-named files because there are only two users and once the file is uploaded, it will be done and not need to be revisited.  

Okay, if your page is in the root directory, then maybe instead of this:

filename= Server.MapPath(".\") & "\" & file.FileName

you need this:

filename= Server.MapPath(".\") & "\asp\uploads\" & file.FileName

FtB
Back to the same old error:

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 29

It was uploading fine right before we did that just now.  It's currently uploading them to the root directory.
Is your upload page in the root directory or in the asp directory?

FtB
asp directory
Okay, then I think that this should be it:

filename= Server.MapPath(".\") & "\uploads\" & file.FileName

FtB
If not, then we will troubleshoot further.

FtB
Didn't work.  Same error.
Okay, here we go again.

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
     response.write(Server.MapPath(".\") & "\" & file.FileName)
     response.end
     filename= Server.MapPath(".\") & "\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>
now it's returning this after the "upload"

C:\Accounts\elevated\wwwRoot\asp\AA048570.JPG

BUT it's not actually uploading them to the server.
Please understand, this is not to upload but to troubleshoot--the part of the code that does the uploading will never execute because of the response.end. Doing what we are doing here allows us to see what is going on; think about this for a minute--I don't know your directory structure and I can't test!!!!!

Okay, back to this.

This path does not look good:

C:\Accounts\elevated\wwwRoot\asp\AA048570.JPG

It is missing the Upload directory. Let's try:

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
     response.write(Server.MapPath(".\") & "\uploads\" & file.FileName)
     response.end
     filename= Server.MapPath(".\") & "\uploads\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>
Now it returns:

C:\Accounts\elevated\wwwRoot\asp\uploads\bible.jpg

And sorry for jumping the gun...  You are definitely the man!
>>You are definitely the man!

I thought I was the man?  ;)
alorentz--you're really jockeying for these points?

haha
Okay, so this looks exactly as it should, so theoretically, the code below should work. If it does not, then it is time to speak to your hosting folks again:

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
      filename= Server.MapPath(".\") & "\uploads\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>
Brilliant!  It works!!!  It's in the correct directory and everything!

Now the only thing is the following asplook.asp page doesn't display the image.  It's coded exactly like the example you sent to me in the first response.
Okay, this should be a different thread, but let's see what we can do here...

FtB
Do you want me to start a new thread?  I'll be glad to.
Let's try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY BGCOLOR="white">
<img src="<%=request.querystring("file")%>">
</BODY>
</HTML>


FtB
>>alorentz--you're really jockeying for these points?

Well, if it was permissions problem, then yes...  If not, then no!  Giddee-up!

alorentz--I'm not sure it was a permissions issue.  according to my hosting company, they said it wasn't--it was coding.  And I just don't know.  So I'm in a quandry here.
So, did the last code sample display your image?

FtB
Nothing.  Just the image icon with a red X on it.
Okay, now if you right click on the image and choose properties, what do you see?

FtB
the URL listed is:

file:///C:/Accounts/elevated/wwwRoot/asp/uploads/bible2.jpg
Okay, I see the problem now and am thinking of the best way to fix this....

FtB
<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
      fileView = file.FileName
      filename= Server.MapPath(".\") & "\uploads\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

And then:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY BGCOLOR="white">
<img src="/Uploads/<%=request.querystring("fileview")%>">
</BODY>
</HTML>
Ok.  Same image with the X and here's the properties:

http://www.elevatedmarketing.com/Uploads/

No filename at all.
Perhaps it is a Case issue. Please try again:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY BGCOLOR="white">
<img src="/Uploads/<%=request.querystring("fileView")%>">
</BODY>
</HTML>

Still nothing.  no filename in the properties.
Are you using this code? There is an extra line added:

<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
      fileView = file.FileName
      filename= Server.MapPath(".\") & "\uploads\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

And then:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY BGCOLOR="white">
<img src="/Uploads/<%=request.querystring("fileview")%>">
</BODY>
</HTML>
<%
'Uncomment ONLY after debugging is complete
'on error resume next

Dim mySmartUpload 'declare the component
Dim intCount ' counter for the number of uploaded files
Dim File 'declare the file to upload
Dim filename 'Temp filename
Dim nextPage 'Next Page to forward to

intCount=0 'initialize the counter

'component creation
Set mySmartUpload= Server.CreateObject("aspSmartUpload.SmartUpload")

'limit the file size to 50 Kb, Larger size not recommended
mySmartUpload.MaxFileSize = 250000

' limit the file extensions to pictures files
mySmartUpload.allowedFilesList="gif,jpg"

'Select files on the user computer
mySmartUpload.Upload
' checking all the files
For each file in mySmartUpload.Files
 If not File.IsMissing then
     ' Add a session number to the file name
      fileView = file.FileName
      filename= Server.MapPath(".\") & "\uploads\" & file.FileName
     file.SaveAs(filename)
     intCount = intCount + 1
 End If
Next

' initialize the object
Set mySmartUpload=nothing

' error managment
If Err.Number = 0 then
  nextPage = "asplook.asp?file=" & filename & ""
Else
  nextPage = "asplook.asp?msg=An error as occured. Try again"
End if

' redirect to the result display
Response.redirect nextPage
%>

___________________________

then


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY BGCOLOR="white">
<img src="/Uploads/<%=request.querystring("fileView")%>">
</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
YOU DID IT!  YOU ARE THE MAN!  It works!

I think I can hear angels singing!

THank so much for the help!
Glad to have helped and good luck with your project.

FtB
I really appreciate it and I'm sure I'll be back!