Results 1 to 5 of 5

Thread: [RESOLVED] MAke Files Downloadable Using VB6

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2010
    Posts
    51

    Resolved [RESOLVED] MAke Files Downloadable Using VB6

    i am trying to Copy uploaded files from one folder to another using vb6(like a download Funtion)

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: MAke Files Downloadable Using VB6

    I think you should provide more details, otherwise, why not use VB's FileCopy function?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2010
    Posts
    51

    Re: MAke Files Downloadable Using VB6

    Quote Originally Posted by LaVolpe View Post
    I think you should provide more details, otherwise, why not use VB's FileCopy function?
    I am using this code to Send Files into a folder "like Upload File control"
    1 Code:
    1. Private Sub Command1_Click()
    2. Dim strSourceFileName As String
    3. Dim strDestination As String
    4.  
    5. On Error GoTo ERR_Handler
    6.  
    7.     'upload file link into database
    8.     cdlUpload.DialogTitle = "Upload File"
    9.     cdlUpload.Filter = "All Files(*.*)|*.*|Office Document 1997-2000(*.doc)|*.doc|Office Document 2003-2010(*.docx)|*.docx|"
    10.     cdlUpload.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
    11.     cdlUpload.ShowOpen
    12.    
    13.     strSourceFileName = cdlUpload.FileName
    14.     strDestination = "C:\test\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
    15.    
    16.     If Not Dir(strDestination) = "" Then
    17.         If MsgBox("Destination file alreay exists. Would like to override existing?", vbYesNo + vbDefaultButton2, "Confirm File Copy") = vbNo Then
    18.             Exit Sub
    19.         End If
    20.     End If
    21.    
    22.     FileSystem.FileCopy strSourceFileName, strDestination
    23.    
    24.     Exit Sub
    25.  
    26. ERR_Handler:
    27.  
    28.     MsgBox "An error has occured while copying file. Operation aborted.", vbExclamation, "File Copy Error"
    29.     Err.Clear
    30.  
    31. End Sub

    Now i need a way to Save it on another destination "File Download control"
    PLease i need Help

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: MAke Files Downloadable Using VB6

    use shbrowseforfolder to allow the user to select a destination folder
    there will be many examples in this forum, or google
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width