• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

example SaveAsVirtual & SaveVirtual

Dear All,

Can anybody quote examples for  SaveAsVirtual  & SaveVirtual using ASPUPLOAD component as .save method is disabled by hosting administrator.

Regards,

0
gulfexpert
Asked:
gulfexpert
1 Solution
 
casstdCommented:
Hi,

         Using aspupload you can only use their method to upload file. Did you try to upload the files? The following code will help you. But you must have write permission to upload file to a folder.

I am not sure about whether the adminstrater can disable a .save method or not.

Set Upload = Server.CreateObject("Persits.Upload.1")
uploaddir = "DOCS"                                          
UPLOADDIRECTORY = Server.MapPath(uploaddir)                  
Upload.OverwriteFiles = true
                  
Count = Upload.Save(UPLOADDIRECTORY)          'if count is 1 then the file is uploaded to the folder
Set File = Upload.Files("File1")
If Not File Is Nothing Then                  
      Filename = File.ExtractFilename
      Ext = UCase(Right(File.Path, 3))
      size = File.size
else
      Filename = ""
End If
            
            

0
 
neeraj523Commented:
Hello

SaveAsVirtual method of ASPUPLOAD will alow you to save your file at virtual path without..

example..

say your web root is

c:\inetpub\wwwroot\myWeb

now you want to save your uploaded file at a location say

c:\inetpub\wwwroot\myWeb\myUploads

than you need to code it like this

<%
File.SaveAsVirtual "/myUploads/" & File.FileName
%>

neeraj523
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now