Jag har skaffat webbhotell... och dom stöder inte aspsmart upload..
så jag undrar om nån skulle fixa koden så att den passar deras upload komponent SAFileUp...
On Error Resume Next
Dim mySmartUpload
Dim intCount
Dim file
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.AllowedFilesList = "gif,jpg,jpeg"
mySmartUpload.DenyPhysicalPath = True
mySmartUpload.MaxFileSize = 400000
mySmartUpload.TotalMaxFileSize = 400000
mySmartUpload.Upload
For each file In mySmartUpload.Files
If not file.IsMissing Then
file.SaveAs("user_photo/" & Session("id") &".jpg")
intCount = intCount + 1
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("databas")&";pwd=lösen"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Addera = "Select * From members Where id=" &Session("id")
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic
RecSet("bild") = "user_photo/" & Session("id") &".jpg"
RecSet.Update
'If Err Then
Response.Write("<b>Fel : </b>" & Err.description)
End If
Next
RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
Response.Redirect "installningar.asp"
<%@ Language=VBScript %>
<% Option Explicit
'-----------------------------------------------------------------------
'--- FileUp Simple Upload Sample
'---
'--- This sample demonstrates how to perform a single file upload
'--- with FileUp
'--- Copyright (c) 2002 SoftArtisans, Inc.
'--- Mail: [email]info@softartisans.com[/email] [url]http://www.softartisans.com[/url]
'-----------------------------------------------------------------------
%>
<HTML>
<HEAD>
<TITLE>SoftArtisans FileUp Simple Upload Sample</TITLE>
</HEAD>
<BODY>
<H3 ALIGN=center>FileUp Simple Upload Sample</H3>
<!--
Note: For any form uploading a file, the ENCTYPE="multipart/form-data" and
METHOD="POST" attributes MUST be present
-->
<FORM ACTION="formresp.asp" ENCTYPE="MULTIPART/FORM-DATA" METHOD="POST">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">Enter Filename:</TD>
<!--
Note: Notice this form element is of TYPE="FILE"
-->
<TD ALIGN="LEFT"><INPUT TYPE="FILE" NAME="myFile"><BR>
<I>Click "Browse" to select a file to upload</I>
</TD>
</TR>
<TR>
<TD ALIGN="RIGHT"> </TD>
<TD ALIGN="LEFT"><INPUT TYPE="SUBMIT" NAME="SUB1" VALUE="Upload File"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<%@ Language=VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<TITLE>SoftArtisans FileUp Upload Simple Sample</TITLE>
</HEAD>
<BODY>
<%
'-----------------------------------------------------------------------
'--- FileUp Simple Upload Sample
'---
'--- This sample demonstrates how to perform a single file upload
'--- with FileUp
'--- This is the ASP form-response script that uses FileUp to receive and
'--- process the upload submitted from form.asp
'--- Copyright (c) 2002 SoftArtisans, Inc.
'--- Mail: [email]info@softartisans.com[/email] [url]http://www.softartisans.com[/url]
'-----------------------------------------------------------------------
'--- Declarations
Dim oFileUp
'--- Instantiate the FileUp object
Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")
'--- Set the Path property to the location you wish to
'--- temporarily cache the incoming file before saving
'--- Note: This property must be set immediately after
'--- instantiating the FileUp object
oFileUp.Path = Server.MapPath(Application("vroot") & "/temp")
'--- Check to be sure there was a file selected in the form
'--- If so, continue processing
If Not oFileUp.Form("myFile").IsEmpty Then
'--- Save the file
'--- Note: The Save() method saves the file
'--- with its original name to the directory
'--- you set as the Path property.
'--- To save a file to a different location
'--- or with a different name, use the SaveAs() method
'--- instead of Save()
oFileUp.Form("myFile").Save
'--- The file is saved, display a confirmation message
Response.Write("<B>File saved successfully on the server as:</B><BR>")
'--- The ServerName() property is the full path of the file
'--- where it was saved on the server
Response.Write(oFileUp.Form("myFile").ServerName)
Else
Response.Write("Error: There was no file submitted for upload.")
End If
'--- Destroy objects
Set oFileUp = Nothing
%>
</BODY>
</HTML>
nu har jag klagat på webhotellet :) och dom har fixat ASPupload , och JA, jag har läst artiklar men får det inte att funka så jag gav upp... det är samma kod men nu till ASPupload...