Link to home
Start Free TrialLog in
Avatar of driven13
driven13

asked on

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.
Avatar of Venabili
Venabili
Flag of Bulgaria image

Avatar of driven13
driven13

ASKER

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.
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.
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.

https://www.experts-exchange.com/questions/25099776/Classic-ASP-Jquery-uploader.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
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.
ASKER CERTIFIED SOLUTION
Avatar of tobzzz
tobzzz
Flag of Spain 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
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

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
%>


Hey.

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

--d.
Change your path to:
D:\my\path\to\hosting\uploadedfiles\*.*
I missed the *.* when I provided the code for you, sorry about that...
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.
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