Reply
ASP Uploader, path problems
Old 08-10-2005, 03:50 PM ASP Uploader, path problems
Junior Talker

Posts: 1
Hi,

I'm developing an asp uploader to upload word documents, but having problems getting it to upload, I think it may be a path problem. With the code below, the file uploads fine on the macintosh platform, but on PC does not upload, which lead me to believe it was the way the path is written.

Here's the code:



I'm very new at this stuff, so any help is greatly appreciated!
Code:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn_watershed.asp" -->
<%
Dim rs_upload
Dim rs_upload_numRows

Set rs_upload = Server.CreateObject("ADODB.Recordset")
rs_upload.ActiveConnection = MM_conn_watershed_STRING
rs_upload.Source = "SELECT * FROM tbl_upload"
rs_upload.CursorType = 0
rs_upload.CursorLocation = 2
rs_upload.LockType = 1
rs_upload.Open()

rs_upload_numRows = 0
%>


<!-- #include file="upload.asp" -->

<%

'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
'          FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
'          FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
'          OR LATER.


' Create the FileUploader
Dim Uploader, File
Set Uploader = New FileUploader

' This starts the upload process
Uploader.Upload()

'******************************************
' Use [FileUploader object].Form to access 
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************


' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
        Response.Write "File(s) not uploaded."
Else
        ' Loop through the uploaded files
        For Each File In Uploader.Files.Items
                
                ' Check where the user wants to save the file
                If Uploader.Form("saveto") = "disk" Then
        
                        ' Save the file
                        File.SaveToDisk "d:\virtuals\cwh\victorbernard_ca\restigoucheriverw  atershed_ca\web\download"
        
                ElseIf Uploader.Form("saveto") = "database" Then
                        
                        ' Open the table you are saving the file to
                        Set RS = Server.CreateObject("ADODB.Recordset")
                        RS.Open "MyUploadTable", "CONNECT STRING OR ADO.Connection", 2, 2
                        RS.AddNew ' create a new record
                        
                        RS("filename")    = File.FileName
                        RS("filesize")    = File.FileSize
                        RS("contenttype") = File.ContentType
                
                        ' Save the file to the database
                        File.SaveToDatabase RS("filedata")
                        
                        ' Commit the changes and close
                        RS.Update
                        RS.Close
                End If
                
                ' Output the file details to the browser
                Response.Write "File Uploaded: " & File.FileName & "<br>"
                Response.Write "Size: " & File.FileSize & " bytes<br>"
                Response.Write "Type: " & File.ContentType & "<br><br>"
        Next
End If

%>

Last edited by hutch80 : 08-10-2005 at 03:52 PM. Reason: More specific
hutch80 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-19-2005, 11:35 AM
vivekar's Avatar
Webmaster Talker

Posts: 541
Why there is some space in "d:\virtuals\cwh\victorbernard_ca\restigoucheriver w atershed_ca\web\download"

May be due to that.

You can give relative path and then try.
__________________
| Submit URL at All the Websites Directory
| Get Certified in Web Design
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Old 08-29-2005, 12:33 AM
Novice Talker

Posts: 12
Location: Denver, Colorado
If the space is not a problem, a bit thing I sometimes forget with file uploaders is that you need to change the permissions on the folder that you are uploading to so that Internet Users can write to that folder.
__________________
Crystal Clear Designs, LLC :: A denver based web design, web marketing, and asp development company.
ccdesigns is offline
Reply With Quote
View Public Profile Visit ccdesigns's homepage!
 
Reply     « Reply to ASP Uploader, path problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11567 seconds with 12 queries