VB.NET - Get File size of incoming file

Ryan Lashway 61 Reputation points
2022-12-04T16:50:33.987+00:00

Is it possible to obtain a file being sents original size and report it in VB.NET as File Size, Copying Size?

I know how to do this if I am the one copying the files to and from a location, but we have a media center that copies files from a remote location and I am writing an application that scans the destination directory for the new file. The issue I am having is users are being notified that a new files has been copied but they can not access it until the copy is complete.

I am just looking for the following scenario:
File test.zip is 1.2GB
File test.zip is copied to a location by another user, but once it shows as being in the folder I can read that the original file size is 1.2GB and of that 100mb has been copied, then one the 1.2GB has been reported as copied I would then notify the end users, not prior to complete file copy.

Developer technologies VB
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2022-12-05T01:49:22.69+00:00

    Hi @Ryan Lashway ,
    Maybe you can consider providing a progress dialog box for file operations.
    Use FileSystem.CopyFile(String, String, UIOption, UICancelOption).
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Ryan Lashway 61 Reputation points
    2023-01-10T14:33:22.963+00:00

    I have resolved the issue, I am not reporting to the end user when a new file appears, I am scanning incoming files on size and once the size does not increase, then notifying them.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.