DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Active file copy

Hybrid View

  1. #1
    T TADCOCK Guest

    Active file copy


    I've tried using the VB file copy stmt and function ( actually a number of
    textbooks call it a stmt, but it must exist in both forms ).

    I can get it to work fine, in both an executable program, and even in an
    activeX control, except that in activeX it only works during a test ( start/run
    ) when in the IDE. However, after compiling the activex control and deploying
    to a HTML page ( the one deployment creates for you ) the control displays,
    but won't execute the file copy stmt. It reports an error that the (source)
    file doesn't exist, which it does. I'm using everything, including the activex
    control, support files, html page, and file that is to be copied from the
    same hard drive directory, an in my code, my destination file is simply designated
    as the file name --- no directory given.

    Is the file copy stmt/function allowed to work inside a browser via an activex
    control? ... or does the browser at that point only understand URL-type
    locations, instead of directory locations? I don't know what I'm missing.
    I'm quite a novice at dealing with activex, in general.

    Many thanks for any info.




  2. #2
    Jeremy Guest

    Re: Active file copy

    Only URL type addresses are recongized when trying to do what you want, also
    when using a non-windows client you would most likely run into other issues.
    ADO 2.5 has a solution you may be looking for. It is streaming or recod
    copying. ADO 2.5 now references your file system as a directory structure
    (that's just an easy way to explain it). Because of this, you can then copy
    files from web server to web server, or web server to your machine. There
    are examples on the MSDN site. Do a search for "LoadFromFile" or
    "CopyRecord" to get info as msdn.microsoft.com

    Here is a code snippet I use to files locally instead of filecopy.

    Reference the ADO 2.5 library in your project

    Private Sub SimpleCopy(src as string,dest as string))

    Dim oStream as ADODB.stream

    set oStream = new ADODB.stream

    oStream.Open
    oStream.Type = adoBinary 'The adoBinary is not the right constant I can't
    think of it off the top of my head.

    oStream.LoadFromFile src
    oStream.SaveToFile dest

    end Sub

    You would most likely want to use the ADODB.record object in order to solve
    the URL issues. I also don't know if this would work on a non-windows
    client, but it does on a windows client.

    Jeremy Stein

    <T TADCOCK> wrote in message news:39c91c5c$1@news.devx.com...
    >
    > I've tried using the VB file copy stmt and function ( actually a number of
    > textbooks call it a stmt, but it must exist in both forms ).
    >
    > I can get it to work fine, in both an executable program, and even in an
    > activeX control, except that in activeX it only works during a test

    start/run
    > ) when in the IDE. However, after compiling the activex control and

    deploying
    > to a HTML page ( the one deployment creates for you ) the control

    displays,
    > but won't execute the file copy stmt. It reports an error that the

    (source)
    > file doesn't exist, which it does. I'm using everything, including the

    activex
    > control, support files, html page, and file that is to be copied from the
    > same hard drive directory, an in my code, my destination file is simply

    designated
    > as the file name --- no directory given.
    >
    > Is the file copy stmt/function allowed to work inside a browser via an

    activex
    > control? ... or does the browser at that point only understand URL-type
    > locations, instead of directory locations? I don't know what I'm missing.
    > I'm quite a novice at dealing with activex, in general.
    >
    > Many thanks for any info.
    >
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center