I encountered a file which seems to be corrupted. Whenever I open and then close that file on adobe reader then a pop up comes to save that file again without any changes. This made me believe that this file is corrupted.
I am using PDFBox to Merge multiple files. While merging this particular file I am getting below error:
Error: Expected a long type at offset 8489, instead got ''
I am looking for the way where I can first repair this file and then merge. So, that code doesn’t fail for errors in the file.
PS : If the save this particular file using adobe reader and then try to merge then it got successfully merged.
Related
I have some programs written in VB6 which use a 30MB Access 2007 data file named BidBase.accdb. I have been able to open this file in Access 2007 for years, but now when I try, Access says "The document 'BidBase.accdb' caused a serious error the last time it was opened."
Here's where it gets strange:
If I rename the file to anything else, such as BidBase1.accdb, Access will open it.
If I copy the same file to another directory Access will open it.
My VB6 programs which use this file still open it and work with it okay.
My PC is setup to make daily backups of my VB6 projects to an external hard drive.
Opening the same file in one of those backup directories works, but if I copy that file to the root directory of that drive, it doesn't work. But on my internal drive, it's just the opposite - it won't load from in my VB6 directory but will load when copied to C:.
I don't have to open it with Access very often. I recently got a new PC on which I installed Access from the original disc, and that's where I first got the error, but when I went back to the old PC, the same thing happens, so it would not seem to be a problem with my PC. In other words, it's hard to imagine that reinstalling Access or any other potential solutions specific to this PC would help.
In 40 years of working with PCs, this is the most bizarre, inexplicable thing I've ever seen.
Try this:
Backup your file
Rename the file
Open the file in Access
"Save as" the file naming it BidBase.accdb
Close Access
Open BidBase.accdb
I tried loading it under a different name but when I did a Save-As, it gave me the same error message as when I tried to open it, even though the file is not present by that name any more, indicating that Access is keeping track of the problem file by name, but still doesn't explain why it flagged the file under that name but not the same file under other names.
But the next oddity is that it did save it under the name BidBase.accdb, but that file is only 5MB while the original is 31MB. I've compared the two files and the contents appear to be the same.
And now that my attention has been drawn to that, I realize that the largest table in the database has about 10k records, meaning that each record in the 31MB DB would have 3,100 bytes, which isn't remotely possible.
I also tried using the newly saved file under the old name in my programs and they work, but then they also worked with the old file under the old name when Access wouldn't.
So I'll keep working with the new file for a while to make sure it's okay, but this is all still a bizarre mystery to me.
I am using CGI DSPSTMF command to display stmf file on web browser. I am copying a spool file to a stmf file using CPYSPLF *STMF option. Once copied i am passing IFS location to DSPSTMF command but it is going to download automatically and when i open the download file i am getting all Junk data any idea why?
Also, i noticed it is using CONTTYPES file in CGILIB and on my server it is empty. What should be the values in it and what should i do show correct data instead of junk. I tried to use different methods to copy the file to IFS like used cpytostmf instead of cpysplf but on IFS file looks correct not the download version.
What CCSID is the resulting stream file tagged with?
use WRKLNK and option 8=Display attributes
If 65535, that tells the system the data is binary and it won't try to translate the EBCDIC to ASCII.
The correct fix is to properly configure your IBM i so that the stream file is tagged with it's correct CCSID.
Do a WRKSYSVAL QCCSID ... if your system is still set to 65535, that's the start of your problem. But this isn't programming related, you can try posting to Server Fault but you might get better responses on the Midrange mailing list
I have crazy error when put prestashop form one to another server:
Warning: PHP Startup: Compilation failed: invalid UTF-8 string at offset 5 in /presta/classes/Dispatcher.php on line 931
and full
I have no idea what will be wrong:( data base have same coding, module/themes I may delete folder, error still will be here
Have you modified this file in some editor? Like notepad? Without saving it with proper encoding?
Or maybe there were some issues with file transfer? Remember that it's always recommended to transfer many files as one .zip package and unpack it after upload.
At the end, this could be a server issue but my guess is that something went wrong during file transfer process.
Running a refresh on the first file then an update on all others. Recurse may not be necessary.
<cfindex
action=refresh
collection="this_name_solr"
key="c:\inetpub\wwwroot\myappname\thefolder\thesubfolder\thefile.ext"
type="file"
urlpath="http://#application.root#/appname/thefolder/thesubfolder/thefile.ext"
extensions=".html, .htm, .xls, .xlsm, .doc, .docx, .pdf, .txt"
recurse="yes"
status="alldocs"
language="English">
Does fine until it hits a corrupt PDF File. If I try to open the file manually in PDF reader I get the message that the file may be corrupt.
I need it to get past this file and continue indexing the rest. I have tried a request timeout of three minutes but that does not work. I have attempted CFPDF Info extraction but it hangs reading it too. I do not know how to test the doc to see if it is corrupt.
Ultimately I would like it to give up on the file after about 3 minutes.
Any suggestions
I am trying to watch files in a directory to determine when files are opened/accessed. I thought FileSystemWatcher would do the trick using the event Changed.
Problem is that some applications do not create a lock on the file they open/access or change either the date modified or date accessed (even after fsutil behavior set disablelastaccess 0). Notepad for example. Apparently is makes a copy of the file in memory and plays with it there until you save it. Nor does it update the Date Accessed.
How can I monitor a directory of files and be notified when a file is simply opened/accessed by any program (e.g. Notepad)? Files may be opened from another computer, not necessarily on the computer running the "watcher".
I found lots of similar questions but did not see one focusing on file "access".
This is quite normal. Updating an existing file is quite dangerous since it can cause irretrievable data loss. A disk error (like disk full) while writing is very bad news. The common algorithm used:
rename the original file
write a new file using the original name
no error: delete the renamed file
error: delete the new file, rename original file back
Clearly this doesn't cause a Changed event to be raised, no file was changed.
Sorry, I didn't read the question well enough. There is no notification whatsoever for an app just opening a file for reading. FSW can only detect changes to the file system. There is no ready alternative either, this requires a custom file system filter driver that snoops on driver requests. Like the kind that SysInternals' ProcMon utility uses. I'm not aware of such a driver ready for use in a C# program, you can't write them in C# either. This just isn't a common requirement.