Registreer FAQ Berichten van vandaag


Ga terug   Scholieren.com forum / Technologie / Software & Hardware
Topic gesloten
 
Topictools Zoek in deze topic
Oud 30-06-2003, 13:00
katten
katten is offline
Onderstaand script is een script om files te uploaden naar een server. Kan iemand me helpen ? Ik ken nl niets van ASP. Het moet naar de server http://www.beac.bizland.com . Alvast Bedankt




<%@ Language=VBScript %>
<%
option explicit
Response.Expires = -1
Server.ScriptTimeout = 600
%>
<!-- #include file="freeaspupload.asp" -->
<%


' ****************************************************
' Change the value of the variable below to the pathname
' of a directory with write permissions, for example "C:\Inetpub\wwwroot"
Dim uploadsDirVar
uploadsDirVar = "D:\wwwroot\favoritesmanagercom\www\database\tempUploads"
' ****************************************************

' Note: this file uploadTester.asp is just an example to demonstrate
' the capabilities of the freeASPUpload.asp class. There are no plans
' to add any new features to uploadTester.asp itself. Feel free to add
' your own code. If you are building a content management system, you
' may also want to consider this script: http://www.webfilebrowser.com/

function OutputForm()
%>
<form name="frmSend" method="POST" enctype="multipart/form-data" action="uploadTester.asp" onSubmit="return onSubmitForm();">

<HTML>
<HEAD>
<TITLE>BEAC FILE UPLOADER</TITLE>
<style>
BODY {background-color: white;font-family:arial; font-size:12}
</style>
<script>
function onSubmitForm() {
var formDOMObj = document.frmSend;
if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" )
alert("Please press the browse button and pick a file.")
else
return true;
return false;
}
</script>

</HEAD>

<BODY>

File 1: <input name=attach1 type=file size=35><br>
<br>
<br>
<input style="margin-top:4" type=submit value="Upload">
</form>
<%
end function

function TestEnvironment()
Dim fso, fileName, testFile, streamTest
TestEnvironment = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(uploadsDirVar) then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not exist.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
fileName = uploadsDirVar & "\test.txt"
on error resume next
Set testFile = fso.CreateTextFile(fileName, true)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
exit function
end if
Err.Clear
testFile.Close
fso.DeleteFile(fileName)
If Err.Number<>0 then
TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have delete permissions</B>, although it does have write permissions.<br>Change the permissions for IUSR_<I>computername</I> on this folder."
exit function
end if
Err.Clear
Set streamTest = Server.CreateObject("ADODB.Stream")
If Err.Number<>0 then
TestEnvironment = "<B>The ADODB object <I>Stream</I> is not available in your server.</B><br>Check the Requirements page for information about upgrading your ADODB libraries."
exit function
end if
Set streamTest = Nothing
end function

function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey

Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
SaveFiles = "<B>Files uploaded:</B> "
for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
next
else
SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
end if
end function
%>

<p>

<br><br>
<div style="border-bottom: #A91905 2px solid;font-size:16">Upload files to your server</div>
<%
Dim diagnostics
if Request.ServerVariables("REQUEST_METHOD") <> "POST" then
diagnostics = TestEnvironment()
if diagnostics<>"" then
response.write "<div style=""margin-left:20; margin-top:30; margin-right:30; margin-bottom:30;"">"
response.write diagnostics
response.write "<p>After you correct this problem, reload the page."
response.write "</div>"
else
response.write "<div style=""margin-left:150"">"
OutputForm()
response.write "</div>"
end if
else
response.write "<div style=""margin-left:150"">"
OutputForm()
response.write SaveFiles()
response.write "<br><br></div>"
end if

%>

<div style="border-top: #A91905 2px solid;font-size:10">Powered by <A HREF="http://www.freeaspupload.net/" style="color:black">Free ASP Upload</A></div>

</BODY>
</HTML>
__________________
Friends Are 4EVER !!!
Advertentie
Oud 30-06-2003, 13:12
dafelix
Avatar van dafelix
dafelix is offline
*zucht*

als je ergens een script download staat er ook wel bij hoe je het moet installeren
__________________
$karma++;
Oud 30-06-2003, 13:35
Koen
Avatar van Koen
Koen is offline
Citaat:
katten schreef op 30-06-2003 @ 14:00:
Ik ken nl niets van ASP.

Ga dan eerst de basis leren en dáárna moeilijke scripts proberen te installeren, of lees de help eens goed door, want hier kan niemand je mee helpen.

Gesloten.
Advertentie
Topic gesloten


Regels voor berichten
Je mag geen nieuwe topics starten
Je mag niet reageren op berichten
Je mag geen bijlagen versturen
Je mag niet je berichten bewerken

BB code is Aan
Smileys zijn Aan
[IMG]-code is Aan
HTML-code is Uit

Spring naar

Soortgelijke topics
Forum Topic Reacties Laatste bericht
Studeren Help mij met mijn onderzoek! en win een Sony E-Reader
Joep1986
6 04-08-2010 18:16
De Kantine Welke mbo´ers willen mij helpen?!
quizmaster1
9 16-05-2006 19:51
Software & Hardware [PHP] MSN Messenger; COM object
Verwijderd
14 17-12-2004 14:50
Software & Hardware [ASP] Forms
Kaladan
5 08-01-2004 18:50
Software & Hardware asp
joost_vd
5 06-03-2002 18:19
Huiswerkvragen: Klassieke & Moderne talen help me , info Pieter Aspen en interview gezocht???
Sylvieke
1 17-05-2001 20:20


Alle tijden zijn GMT +1. Het is nu 00:11.