Re: Where are Attachments Stored? by Mandar
Mandar
Thu Sep 29 11:14:04 CDT 2005
Whats the column name for attachment files in the annotationbase table,
is it documentbody
my file sample attached is 22 kb,how should I write code i follwed this
approach but doesnt work
:buffer size 10000.
while (myReader.Read())
{
// Get the employee id, which must occur before getting the
employee.
// Create a file to hold the output.
fs = new FileStream("C:\\faximage1.tif",FileMode.OpenOrCreate,
FileAccess.Write);
bw = new BinaryWriter(fs);
// Reset the starting byte for the new BLOB.
startIndex = 0;
// Read the bytes into outbyte[] and retain the number of bytes
returned.
retval = myReader.GetBytes(1, startIndex, outbyte, 0, bufferSize);
// Continue reading and writing while there are bytes beyond the
size of the buffer.
while (retval == bufferSize)
{
bw.Write(outbyte);
bw.Flush();
// Reposition the start index to the end of the last buffer and
fill the buffer.
startIndex += bufferSize;
retval = myReader.GetBytes(1, startIndex, outbyte, 0,
bufferSize);
}
// Write the remaining buffer.
bw.Write(outbyte, 0, (int)retval);
bw.Flush();
// Close the output file.
bw.Close();
fs.Close();
}
// Close the reader and the connection.
myReader.Close();
conn.Close();
CRM Expert wrote:
> Every Attachment store with CRMNoteManager as notes. We make a add-on which
> support to add multiple attachments on single screen like yahoo mail.
>
> See the AnnotationBase Table, there is attachment stored . all notes ,
> attachments store inthis table. and to get use CRMNoteManager .
>
> Feel free to contact me if any query - mscrmexpert@gmail.com
>
> Thanks,
> MVP- .Net
>
>
> "UncleB" wrote:
>
> > I have attached a number of documents in Notes on various accounts, and I
> > have restored the entire database to my DR Site. Happily, everything is
> > working as expected, and I see the attachments in the backup installation.
> > However, I am not sure whether they are stored as binary files in the
> > database and are being backed up and restored with the database, or
> > whether they are stored as some kind of link. I see the entries in the
> > AnnotationBase table. Does anyone know where the physical file from an
> > attachment is stored? I want to make sure that if my primary server is
> > unavailable, the backup copy will still be downloadable and readable.
> >
> > If nobody knows, I will shut down my primary server after hours and then
> > make sure that the attachments are still there, but it would sure help if
> > anyone can shed any light on this.
> >
> > Thanks.
> >
> > Bernard Spanger
> > Reluctant part-time CRM Administrator :)
> >
> >
> >