Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have a simple question, i have window service that run in specific interval.
Now i have one issue when user upload a big file and during same time window service run and convert that file to mp4 using ffmpeg but original video is not uploaded completely. therefor converted video does not works.

So i want to convert file only after video upload finished. How can i know that video file is uploaded successfully or not ?

user uploads file using Filezilla or other ftp clients.

Thanks in Advanced..
Posted
Updated 18-Dec-15 2:38am
v2
Comments
ZurdoDev 18-Dec-15 8:32am    
Depends on what code you are using to upload the file.
Member 11324668 18-Dec-15 8:36am    
user uploads file using filezila or other ftp clients

1 solution

Your FTP server should know which files are actually being uploaded.

A good implemented server would also lock the file even for reading while the upload is in progress. Then your service might detect the new file but will be not be able to open it.

If there is no read lock, there should be at least an exclusive write lock. So you can try to open the file for appending (close it immediately upon success). Failure indicates then that the file is still uploading.

The last resort is getting a list of open file handles and check if the file is in the list. But this can be difficult with C# (there is an article using C++ her at CP: Listing Used Files[^]).
 
Share this answer
 
Comments
BillWoodruff 19-Dec-15 4:12am    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900