Biztalk File Moving - biztalk

I have an xml file which consists of "File Id" attribute which denotes the file id of some pdf document.
<StoredDocumentRepresentation>
<DigitalFile FileId="3BSE077611_B001.pdf" xlink:href="files/3BSE077611_B001.pdf" xlink:type="SIMPLE"></DigitalFile>
</StoredDocumentRepresentation>
There will be many pdf with different FileId(pdf will be having FileId as their name)in the Receive Location. I need to pick the pdf with File id mentioned in the xml...
Thanks in Advance

I have used the File.Move() function in my orchestration for picking the PDF files automatically from source to destination location, once my xml file is dropped...

Related

When i'm trying to create microsoft text driver(.txt , .csv) pointing to some specified .csv file,it don't show the file in Select directory?

Actually my intension is talking with non-conventional database like ms=excel,txt files. When i'm trying to create microsoft text driver in data source pointing to some .csv file and also trying to some file in my drives.. in that select Directory file is not visible to pointing it is in hidden mode What is the problem.
You must point to the directory in ODBC first, then set the options for the defined column header format. The ODBC connection will recognize all text files in the directory, and follow the header formats for the columns you must specify

Code to upload an excel file and read it in a dataset

I have a requirement , where in I have to upload an .xlsx file on the server and then read the file into a data table using c# , asp.net.
I need to get your file onto the server.
I need to open the (uploaded?) file.
I need to read the contents of the file, applying any nessesary data parsing.
I need to display the results in a gridview.
Help would be appreciated.

Stamp the existing pdf file and save it again

I want to stamp first page of any existing pdf file with any text enter by the user and save it again or overwrite the file. I found some article about it on google but all are either create a new pdf file or save the stamped file in new pdf file. I want to save the stamping in existing file.
Have you any suggestions or source code.
Thanks in advance
Dinesh Kumar
Check out iTextSharp
You can manipulate PDFs with it.

Getting extension of the file in FileUpload Control

At the moment i get file extension of the file like :
string fileExt = System.IO.Path.GetExtension(filUpload.FileName);
But if the user change the file extension of the file ( for example user could rename "test.txt" to "test.jpg" ), I can't get the real extension . What's the solution ?
You seem to be asking if you can identify file-type from its content.
Most solutions will indeed attempt the file extension, but there are too many different possible file types to be reliably identifiable.
Most approaches use the first several bytes of the file to determine what they are.
Here is one list, here another.
If you are only worried about text vs binary, see this SO question and answers.
See this SO answer for checking if a file is a JPG - this approach can be extended to use other file headers as in the first two links in this answer.
Whatever the user renames the file extension to, that is the real file extension.
You should never depend on the file extension to tell you what's in the file, since it can be renamed.
See "how can we check file types before uploading them in asp.net?"
There's no way to get the 'real' file extension - the file extension that you get from the filename is the real one. If file content is your concern, you can retrieve the content type using the .ContentType property and verify that it is a content type that you are expecting - eg. image/jpg.

ASP.NET localized files

I've got a web page with a link, and the link is suppose to correspond to a PDF is the given user's language. I'm wondering where I should put these PDF files though. If I put them in App_LocalResources, I can't specify a link to /App_LocalResources/TOS_en-US.pdf can I?
The PDF should definitely not be in the App_LocalResources folder. That folder is only for RESX files.
The PDF files can go anywhere else in your app. For example, a great place to put them would be in a ~/PDF folder. Then your links will have to be dynamically generated (similar to what Greg has shown):
string cultureSpecificFileName = String.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture.Name);
However, there are some other things to consider:
You need a way to ensure that you actually have a PDF for the given language. If someone shows up at your site and has their culture specified as Klingon, it's unlikely that you have such a PDF.
You need to decide exactly what the file format will be. In the example given, the file would have to be named TOS_en-US.pdf. It you want to use the 2-letter ISO culture names, use CurrentCulture.TwoLetterISOLanguageName and then the file name would be TOS_en.pdf.
I would store the filename somewhere with an argument in it (i.e. "TOS_{0}.pdf" ) and then just add the appropriate suffix in code:
string cultureSpecificFileName = string.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture);
Does the PDF have to have the same file name for each of the different languages? If not, put them all into a directory and just store the path in your resources file.

Resources