473,750 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

automate file upload using perl

Hi,

I'm trying to automate a process to upload a file to hotmail, but
having a strange error and I don't know what I'm doing wrong with the
script.

below is the code:

use HTTP::Request:: Common;
use LWP;

-- snipped --

$ua = new LWP::UserAgent;
$ua->agent('Mozil la/5.0 (compatible; MSIE 5.5; Windows 98; Win 9x;
Windows 2000)');

$response = $ua->request(POST
'http://by7fd.bay7.hotm ail.msn.com/cgi-bin/doattach',
Content_Type => 'form-data',
Content => [ curmbox => 'F000000001',
HrsTest => '',
attachmentfilen ame => '',
attachorcancel => '',
userfilename => '',
contentType => '',
smsg => 'jaja.saved',
attfiles => '',
stationery => '',
originalstation ery => '',
ref => '',
RTEbgcolor => '',
from => 'compose',
oldattfile => '',
_HMAction => '',
attfile => ['./text.txt'],
]
);

print ($response->is_success) ? $response->content :
$response->status_line;
The error message returned:
<!-- counter(177) >= nLines(177)! -->
<!-- H: bay7-f64.bay7.hotmai l.com -->
<!-- V: WIN2K 09.07.50.0039 i -->
<!-- D: Sep 3 2003 18:03:53-->
<!-- S: 0-->
I'd appreciate very much if somebody could enlight me with some
inputs.

Thanks.
Jul 19 '05 #1
1 5267
oh, never mind.. it works like charm after I put Content_Length.

ma****@hotmail. com ([nix]) wrote in message news:<f9******* *************** ****@posting.go ogle.com>...
Hi,

I'm trying to automate a process to upload a file to hotmail, but
having a strange error and I don't know what I'm doing wrong with the
script.

below is the code:

use HTTP::Request:: Common;
use LWP;

-- snipped --

$ua = new LWP::UserAgent;
$ua->agent('Mozil la/5.0 (compatible; MSIE 5.5; Windows 98; Win 9x;
Windows 2000)');

$response = $ua->request(POST
'http://by7fd.bay7.hotm ail.msn.com/cgi-bin/doattach',
Content_Type => 'form-data',
Content => [ curmbox => 'F000000001',
HrsTest => '',
attachmentfilen ame => '',
attachorcancel => '',
userfilename => '',
contentType => '',
smsg => 'jaja.saved',
attfiles => '',
stationery => '',
originalstation ery => '',
ref => '',
RTEbgcolor => '',
from => 'compose',
oldattfile => '',
_HMAction => '',
attfile => ['./text.txt'],
]
);

print ($response->is_success) ? $response->content :
$response->status_line;
The error message returned:
<!-- counter(177) >= nLines(177)! -->
<!-- H: bay7-f64.bay7.hotmai l.com -->
<!-- V: WIN2K 09.07.50.0039 i -->
<!-- D: Sep 3 2003 18:03:53-->
<!-- S: 0-->
I'd appreciate very much if somebody could enlight me with some
inputs.

Thanks.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3790
by: ShaSha | last post by:
Hi, I am trying to upload XML files via HTTP to an HTTP server from java client instead of browser. On the HTTP server side, there is a Perl script that will be receiving the incoming file and files it into the designated folders in the server.When I run the Java client, I get the response Status = 200 and also uploaded replies from the Perl script but when I checked in the folder, the XML file is 0 KB. I am not sure what went wrong. Spending a...
0
1685
by: Eric Li | last post by:
Hi, I used to have a web page with "<input type="file" name="FileName" size=20> field to upload file to one of my Perl program in the server side. Now I would like to use C# program to upload file to server but I don't want to change my Perl program. Is there any way to use C# to upload file to Perl program? I know I can use Webclient.UploadFile(URL, "POST", filename) to upload file. However, I believe I have to change something on my...
12
7798
by: JMB | last post by:
Hello, I was wondering if anyone knew of any projects extending the inline upload progress bar to utilize an inpage image uploader with bar, without having to refresh or go to a seperate page, nor opening a second box for display of the progress bar. I had been using the MegaUpload that was adapted from Raditha's script at http://www.raditha.com/upload.php . The MegaUpload script I have been using takes the progress bar inpage,...
1
2725
by: DavidA | last post by:
I have a very simple form and perl script that is to upload a jpg file. I am not familiar with the perl language but copied the code from a text book. It works fine with all browsers except IE. !!!!! The code is able to validate that it is a jpg but never gets to the debugging statement 'in loop" I have seen numerious complaints via google searches about IE and uploads but am unable to decipher the solution. Any help will be...
4
1951
by: Chris | last post by:
I have a web page that I want to automate a post to. I would use the web request. However the post involves a file upload. What would be the best way of doing this? Regards, Chris.
2
2055
by: Lastknight | last post by:
hi all, i have seen a program from web that is used to upload a file from particular directory.. My problem is that they have mentioned some file directory name in the program but when i am running the program, in the browser i am getting the directory is not valid.. In this program i have not involved to do any part,but i need to know about this code.. code for fileupload #!/usr/bin/perl
2
2386
by: naveeddil | last post by:
Hello, I use this command for including my ASP files into another it is working perfectly on my XP 2002 SP2, IIS server and also i upload to brinkster.com and working perfectly there but here is a problem on another server.... i upload my files to a new server but in the ASP file it returned me the Code in SOurce Code Back.. The code I used is: <!-- #include file="header-main.asp" --> the header file is in the same directory
1
2118
by: fortwilliam | last post by:
Hi, I am very new to "object oriented programming". I have this script which I didn't write but have altered and have been using for a while to allow people to upload files to a website. Now I am trying to adapt the same script to upload files to multiple websites specified in an array. This is for a content management system for our websites. I thought I could just stick a foreach loop round most of the script and that would work. However, no...
1
47477
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9342
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6808
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4888
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.