---
title: "Från aspsmartupload till SAFileUp"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/77061-från-aspsmartupload-till-safileup"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Rodan"
published: "2003-05-15T14:38:41.000Z"
updated: "2003-06-23T20:52:33.000Z"
replies: 7
views: 266
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/77061-från-aspsmartupload-till-safileup"
---

# Från aspsmartupload till SAFileUp

## #1 — Rodan, 2003-05-15T14:38Z

Hej

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

MVH/Rodan

\-----------------------------------------------------------------------------------
KODEN
\-----------------------------------------------------------------------------------

```
   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"
```

\-----------------------------------------------------------------------------------

Permalänk: https://www.webforum.nu/p/77061

## #2 — Rodan, 2003-05-15T16:55Z

nån ?

Permalänk: https://www.webforum.nu/p/1050160

## #3 — solbulle, 2003-05-15T18:10Z

Finns det ingen hjälpsida hos ditt hotell? Eller länk till tillverkarens hemsida/FAQ?

Permalänk: https://www.webforum.nu/p/1050200

## #4 — Rodan, 2003-05-16T12:24Z

är det ingen som har jobbat med SAFileUp? för jag behöver det verkligen, det är ett extremt behov av detta...

Permalänk: https://www.webforum.nu/p/1050767

## #5 — OveRRidE, 2003-05-16T12:33Z

Tack Farbror [Google](http://www.google.com)! Du hittade det som ingen annan hittade *igen*! :D

<http://support.softartisans.com/docs/FileUpV4/>

Permalänk: https://www.webforum.nu/p/1050776

## #6 — OveRRidE, 2003-05-16T12:36Z

Titta, det fanns till och med kodexempel. 

```
<%@ 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">&nbsp;</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>
```

Permalänk: https://www.webforum.nu/p/1050780

## #7 — Rodan, 2003-06-23T14:55Z

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

Permalänk: https://www.webforum.nu/p/1091350

## #8 — solbulle, 2003-06-23T20:52Z

Felmess? 
Ta bort raden: On Error Resume Next

Permalänk: https://www.webforum.nu/p/1091522

---

Tråden på webben: https://www.webforum.nu/amne/asp/77061-från-aspsmartupload-till-safileup
