Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How can we delete or move a file when PDF size is 0Byte.

i have placed sample files and sample code.


VB
If file.exist(d:\source\test1.pdf) then
      File.move(d:\source\test1.pdf, d:\destination\test1.pdf)
   End If


or
VB
If file.exist(d:\source\test1.pdf) then
      File.delete(d:\source\test1.pdf, d:\destination\test1.pdf)
   End If


both code doesn't work when pdf size is 0

Note: We cannot preview this pdf. we can Check after downloading pdf from below location

https://drive.google.com/file/d/0B_nzYHWVJJ7KaVZfQUZJVmsxUXM/view?usp=sharing[^]
Posted
Updated 13-Oct-14 20:20pm
v2
Comments
Sergey Alexandrovich Kryukov 14-Oct-14 2:39am    
What's wrong with just reading original MSDN documentation?
—SA

 
Share this answer
 
Comments
vinodh107 14-Oct-14 3:05am    
I have refered above links..still i couldnt solve the problem.
pdf couldn't removed or moved to another location.
Plz note that, our pdf size is "0 BYTE"
Sergey Alexandrovich Kryukov 14-Oct-14 3:23am    
"Couldn't" is not informative. What was the problem?
—SA
Pikoh 14-Oct-14 3:27am    
can you move it or delete it from explorer? maybe that file is blocked by another process...
Sergey Alexandrovich Kryukov 14-Oct-14 3:29am    
Explorer does not contain any files... :-)
If a file is blocked, it's easy to detect. A very good tool is Handle.exe by Sysinternals.
—SA
Pikoh 14-Oct-14 3:39am    
I meant explorer.exe (Windows Explorer,don't know how is it called in english,my windows is in spanish), not IExplore ;) What i think is that they are trying to generate the pdf but the process is failing, making the pdf file being blocked by the process trying to generate it. That's why size is 0.
If the problem is "…because it is being used by another process", please see my past answer:
how to compress the error 'it is already used by another process' in vb.net[^].

—SA
 
Share this answer
 

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



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