on 11-06-2007 8:33 AM
Hi All,
I have a requirement like this. I need to pick a file from a website for which i have the link and the file name . Its a .csv file. can i use file adapter to pick that file? can i mention the http link in the source directory field? or suggest me some way to pick that file . Its a website not a web service.
reagrds
jhansi
first of all you need get file from http and place it to your folder. It can be any script, for example php, or java. Script takes file from http and saves it in your folder. And only then, XI takes it from your folder and process it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can u suggest me a blog or some link , to do a sample scenario on this.
and in my requirement , the file name is dynamic.
jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is ur file an attachment in the website or is it a link from where u can download or open?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
maybe u can try with this:
1. get the source location of the file (not the link in the web but the source location from the server the hyperlink is pointing to).
2. If you can get this link u can have a RFC f/m in R3 that wuld get the data from that location and have the file placed in the application server else using FILE adapter u can access the server provided it is FTP enabled.
HI Hema,
A work around i see is to use run operating system command before message processing option in sender file adapter.
Here I'd write a .bat file which which will execute a java class..
Basically I'll write a java class to download the file from the URL and keep it. And this file will be picked up by XI.
May be the same thing can also be achieved using scripts but i have no idea on dat...
Any how, my java code segment wud be something like
try {
String webFile =
"http://www.dilbert.com/comics/dilbert/archive/images/dilbert2002222271107.gif";
URL url = new URL(webFile);
InputStream is = url.openStream();
FileOutputStream fos=new FileOutputStream("C://MyFolder//dilbert2002222271107.gif");
int oneChar;
while ((oneChar=is.read()) != -1)
{
fos.write(oneChar);
}
is.close();
fos.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
hema
as prateek pointed u cannot access file in the website.....stored as an attachment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<i>can i use file adapter to pick that file?</i>
No. File adapter cannot pick the file if the system involved in not an FTP server.
<i>can i mention the http link in the source directory field?</i>
Not possible
Even if u use http adapter, the attachment for sender http is not supported. U said u have url. How exactly does the system storing the file and please clarify the method of accessing the file
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.