Solved

ASPSmartUpload is driving me CRAZY!

Posted on 2004-09-08
82
1,484 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:elevatedmarketing
  • 39
  • 36
  • 7
82 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010453
0
 

Author Comment

by:elevatedmarketing
ID: 12010546
I've tried it, I get an HTTP 500 Server Error.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010568
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
0
 

Author Comment

by:elevatedmarketing
ID: 12010624
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...
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010658
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">

0
 

Author Comment

by:elevatedmarketing
ID: 12010706
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010739
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
0
 

Author Comment

by:elevatedmarketing
ID: 12010761
Glad to know ASPSmartUpload's installed...

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

Adam
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12010774
Sounds like permissions problem!  Do you (IUSR account) have permission to write to that directory?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010787
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
0
 

Author Comment

by:elevatedmarketing
ID: 12010789
which directory should I modify in my hosting control panel?  the whole thing?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010797
@alorentz--

It is pointing to the root directory right now.

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12010826
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

0
 
LVL 31

Expert Comment

by:alorentz
ID: 12010874
Maybe no permissions to add files at all anywhere...?  Have to talk to Host about that.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010899
Sorry, I am being a bozo!!

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

 filename= file.FileName

FtB

0
 

Author Comment

by:elevatedmarketing
ID: 12010924
Same error message...

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 31
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010973
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12011100
One other thing to try in case this is a path issue:



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

Author Comment

by:elevatedmarketing
ID: 12011185
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12011220
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12011280
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
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12011368
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12011427
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
0
 

Author Comment

by:elevatedmarketing
ID: 12012351
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?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012394
What is the error and line number? Also, what size of file were you uploading?

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12012414
THe Error is:

aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/asp/upload.asp, line 31


The file is 4.07 Kb.
0
 

Author Comment

by:elevatedmarketing
ID: 12012425
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012428
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
0
 

Author Comment

by:elevatedmarketing
ID: 12012476
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012488
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


0
 

Author Comment

by:elevatedmarketing
ID: 12012508
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!
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012525
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
0
 

Author Comment

by:elevatedmarketing
ID: 12012535
OK.  Now I got:

C:\Accounts\elevated\wwwRoot\asp1035689867_alaskabike.jpg
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012548
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
%>
0
 

Author Comment

by:elevatedmarketing
ID: 12012570
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?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012590
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
0
 

Author Comment

by:elevatedmarketing
ID: 12012600
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?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12012608
Please stay with the most recent version. The tests that we performed above show that everything is as it should be.

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12012622
I'm on with TS at my hosting company.  Hope to get this resolved ASAP.

Adam
0
 

Author Comment

by:elevatedmarketing
ID: 12036072
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!
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12036821
See told ya it was permissions :)

Good luck!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12038511
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
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12038739
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
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12038786
If you need assistance closing this question, please let me know...thanks.
0
 

Author Comment

by:elevatedmarketing
ID: 12039960
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12039975
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
0
 

Author Comment

by:elevatedmarketing
ID: 12040018
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.  

0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040064
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
0
 

Author Comment

by:elevatedmarketing
ID: 12040072
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040092
Is your upload page in the root directory or in the asp directory?

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040096
asp directory
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040103
Okay, then I think that this should be it:

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

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040105
If not, then we will troubleshoot further.

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040119
Didn't work.  Same error.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040125
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
%>
0
 

Author Comment

by:elevatedmarketing
ID: 12040147
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040170
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
%>
0
 

Author Comment

by:elevatedmarketing
ID: 12040177
Now it returns:

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

And sorry for jumping the gun...  You are definitely the man!
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12040180
>>You are definitely the man!

I thought I was the man?  ;)
0
 

Author Comment

by:elevatedmarketing
ID: 12040186
alorentz--you're really jockeying for these points?

haha
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040193
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
%>
0
 

Author Comment

by:elevatedmarketing
ID: 12040207
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040217
Okay, this should be a different thread, but let's see what we can do here...

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040225
Do you want me to start a new thread?  I'll be glad to.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040227
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
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12040236
>>alorentz--you're really jockeying for these points?

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

0
 

Author Comment

by:elevatedmarketing
ID: 12040248
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.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040251
So, did the last code sample display your image?

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040255
Nothing.  Just the image icon with a red X on it.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040261
Okay, now if you right click on the image and choose properties, what do you see?

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040278
the URL listed is:

file:///C:/Accounts/elevated/wwwRoot/asp/uploads/bible2.jpg
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040283
Okay, I see the problem now and am thinking of the best way to fix this....

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040291
<%
'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>
0
 

Author Comment

by:elevatedmarketing
ID: 12040319
Ok.  Same image with the X and here's the properties:

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

No filename at all.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040347
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>

0
 

Author Comment

by:elevatedmarketing
ID: 12040361
Still nothing.  no filename in the properties.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040367
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>
0
 

Author Comment

by:elevatedmarketing
ID: 12040373
<%
'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>
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 12040376
Oh boy! Am I ever stupid!!!!

Please change this line:

 nextPage = "asplook.asp?file=" & filename & ""


To:

 nextPage = "asplook.asp?fileView=" & fileView & ""
0
 

Author Comment

by:elevatedmarketing
ID: 12040387
YOU DID IT!  YOU ARE THE MAN!  It works!

I think I can hear angels singing!

THank so much for the help!
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12040395
Glad to have helped and good luck with your project.

FtB
0
 

Author Comment

by:elevatedmarketing
ID: 12040401
I really appreciate it and I'm sure I'll be back!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now