File Upload utility for Classic ASP

Hello experts:

Do you guys know of a utility via which I can upload files to a special directory to my shared hosting on Godaddy (Windows hosting)??

Scenario:  I will have a special web-page that will have the utility in it and I can choose which files I want to upload to the server and it will be saved to this special directory.

Thanx in advance,

--d.
driven13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

driven13Author Commented:
Venabili:

Thanx for the response.

I am trying out the second one that you posted (http://support.microsoft.com/kb/299692 ) as it si both free and seems simple enough.

But as I follow the steps on that page, it asks me tocompile in STEP 9.  Is there a way around this as I do not know how to so this??

Thanx again,

--d.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

VenabiliCommented:
What IDE are you using for the code? Because it should have a compiler there

You need to compile it so you can make the DLL.
0
tobzzzCommented:
Did you see this featured question (now article) in the ASP zone of Experts-Exchange that gives you some really neat code that doesn't require server components, DLLs and so forth? The advantage is, if you moved hosting at any point in time, you would not be reliant on server components/set-up.

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_25099776.html

I've seen a LOT of problems with people using GoDaddy and their set-up so be careful using them and of course, best of luck :-)

/ Tobzzz
0
driven13Author Commented:
Thank you both for the responses.

I am not a programmer but can get around a bit.  So creating DLL files are a bit out of my realm.

tobzzz, I have checked out the link you sent and it looks pretty cool.

My only question is, I did not see an option where you could actually see a listing of all the files in the directory.

Surely, in all these years there has been tons of folks who needed to upload files over the web and see a listing of that directory.  Even in Classic ASP.

Any other options from anyone else out there....???

Thanx,

--d.
0
tobzzzCommented:
Ha, yes absolutely. I commonly use Persits aspUpload, I don't know if GoDaddy has it as a component available. Unlike PHP, ASP doesn't have a good option for uploading without using a component, other than the jQuery like I sent you.

Seeing the content of a directory and printing to screen wth aspUpload is as simple as this:


<%
<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"-->

Set Upload = Server.CreateObject("Persits.Upload")
Set Dir = Upload.Directory("c:\wwwdirectory\websitename\content", SORTBY_TYPE)
For Each item in Dir
   response.write item.FileName & "<br>"
Next
%>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
driven13Author Commented:
tobzzz:

Thanx again,  I am trying to use ASPUpload as Godaddy does have it installed.

It works as I can now upload files to the directoty.

BUT, your code for the listing does not work.

I have included my code below.

Any ideas?

--d.
<html>
  <head>
    <title>File Upload Form</title>
  </head>
  <body bgcolor="#F6FFFF" link="green" vlink="green" alink="green">
  
    <table align="center" width="80%" border="0"> 
	  <tr>
	    <td>
		
		<% 
<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"--> 
 
Set Upload = Server.CreateObject("Persits.Upload") 
Set Dir = Upload.Directory("D:\my\path\to\hosting\uploadedfiles", SORTBY_TYPE) 

For Each item in Dir 
   response.write item.FileName & "<br>" 
Next 
%>
		<font face="ms sans serif" size="-1">
          <li>Use the "Browse..." button below to select the graphic you want associated with this Item:<BR> <center><font color="#cc0033"><b><%=Title%></b></font></center><BR>
		  <li>Then use the "Upload This File" button to transfer the file to the server.
		</font>
          <form action="UploadAction.asp" method="post" enctype="multipart/form-data">
		  <input type="Hidden" name="id" value="<%=StoryID%>">
		  <input type="Hidden" name="title" value="<%=Title%>">		  
          <table cellpadding="4" cellspacing="2" border="1">
            <tr>
		      <td>Select a File: </td>
		      <td><input type="file" name="file_1"></td>
	        </tr>

	        <tr><td colspan="2"><center><input name="cmdUpload" type="submit" value="Upload This File"></center></td></tr>
          </table>
          </form>
        </td>
      </tr>
	</table>
  </body>
</html>

Open in new window

0
tobzzzCommented:
What error are you recieving?

Here's the API from Persits himself:
http://www.aspupload.com/manual_misc.html#9_3

His code (which I modified for you) is:
<%
<!--METADATA TYPE="TypeLib" UUID="{B4E1B2DE-151B-11D2-926A-006008123235}"-->
Set Upload = Server.CreateObject("Persits.Upload")
Set Dir = Upload.Directory( "c:\mydir\*.*", SORTBY_TYPE)
For Each item in Dir
   Response.Write item.FileName &"<BR>"
Next
%>


0
driven13Author Commented:
Hey.

It just displays the word "uploadedfiles", even though there are 5 files in there.

--d.
0
tobzzzCommented:
Change your path to:
D:\my\path\to\hosting\uploadedfiles\*.*
I missed the *.* when I provided the code for you, sorry about that...
0
driven13Author Commented:
That was it!!!  Thank you.

I have two follow-up questions:

1) Is this listing feature a function of ASP/VBScript or does it come with ASPUpload only?

2) What is required to have "delete" buttons beside each of these files names in the listings, so that when I click on it, it will delete it from the server.

Thanx for your time.

--d.
0
tobzzzCommented:
1/ The code only works with persits aspUpload, it's not a vb function.
2/ This line...
Upload.DeleteFile "D:\my\path\to\hosting\uploadedfiles\testfile.txt"
will delete files for you.

Happy to help. Good luck with it all :-)

/ Tobzzz
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.