473,468 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

uploading a file in a website

63 New Member
HI,
I need every day to upload several files to a website (go to site, click "browse", wait for the upload and its done).
I'd like to automate this with a perl script, but I can't figure how.
MY idea is to be monitoring a folder and upload every files that is copy to there. Can someone give me some lights to start a scratch of the script, the problems I could find, modules that can help, etc.

Thanks a lot for any help,

Joćo Correia
Nov 8 '07 #1
9 1708
eWish
971 Recognized Expert Contributor
You could write a script that will transfer the files based on the criteria you desire. Then setup a Cron Job or Scheduled Task that transfers the files for you at said times of the day.
  • Use File::Find to get the files
  • Use Net::FTP to transfer files
  • Create Cron Job / Scheduled Task.

--Kevin
Nov 9 '07 #2
jcor
63 New Member
I already have something like what you said but with File::Monitor and Net::FTP.
My problem is that the site is not a ftp server and I don't think I can upload files to there via ftp. But I don't have a clue of how can I do that. Imagine you want to upload a video to youtube.com, You can do that via ftp? You must browse your computer and upload it. It's something ike that I need.

thanks for your help,

Joćo
Nov 9 '07 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
I already have something like what you said but with File::Monitor and Net::FTP.
My problem is that the site is not a ftp server and I don't think I can upload files to there via ftp. But I don't have a clue of how can I do that. Imagine you want to upload a video to youtube.com, You can do that via ftp? You must browse your computer and upload it. It's something ike that I need.

thanks for your help,

Joćo
If the file selection is what you are trying to do, then you can do that with HTML. You would do an input box in a form and set the type to file and it should have a button to click. Check on the w3c website for more information.

Regards,

Jeff
Nov 9 '07 #4
jcor
63 New Member
What I really would like to do is, and a I don't now if it's possible or how to do it is:

Start running a script that upload every files in a particular folder to one particular site, like if I have clicked the button, browse, and uploaded the file. I don't know how I could identify the site or the field in the site where the file should be uploaded, guess it can be hard to do.

Just wondering if its possible, and trying to get some ideas to do this.

Thanks,

Joćo
Nov 9 '07 #5
numberwhun
3,509 Recognized Expert Moderator Specialist
What I really would like to do is, and a I don't now if it's possible or how to do it is:

Start running a script that upload every files in a particular folder to one particular site, like if I have clicked the button, browse, and uploaded the file. I don't know how I could identify the site or the field in the site where the file should be uploaded, guess it can be hard to do.

Just wondering if its possible, and trying to get some ideas to do this.

Thanks,

Joćo
Ok, I now believe that you are completely confused and truly do not know what you want.

In your last post, you asked how it is possibly to upload something by clicking on a button, browsing for the file you want to upload, then uploading it. I gave you an answer to that and then you go and describe something TOTALLY different.

You need to sit down and describe EXACTLY what it is that you want to do. Don't say, "like this but do this instead". Uploading a file by selecting it and uploading all the files in a directory with a script are two different things and not even closely like each other.

Once you can accurately describe exactly what it is you are looking for, please feel free to post it here and we will see if we can help you. Also, it would help dramatically if you post the code you are working with if that is what you are trying to troubleshoot.

Your changing your statement every other posting makes me think we are wasting our time trying until you better describe what you want to do.

Regards,

Jeff
Nov 9 '07 #6
jcor
63 New Member
Sorry for the confusion. I'll try to be clear now:

I need to distribute several files to several destinations.
The files are created in any computer of my network and when finished are stored in a specific folder and computer.

one destination is to send via FTP;
other destination is to send via SFTP;
other destination is to send uploading the file in a site (as I tried to describe before)

I already automated the first to "sendings", using File::Monitor to be watching the specific folder, and every file dropped in that folder is sent using modules Net::FTP and Net::SFTP.

For the third place, I'm not working in any code yet, just start thinking how could be done. Probably I can use the "watching" in my script. But the uploading part, I don't have a clue.

Hope I've been clear this time and you can help me

thanks,

Joćo
Nov 9 '07 #7
Atli
5,058 Recognized Expert Expert
Hi Joćo.

The only way I can think of would be to have your code send a HTTP request to the server, just like your browser would.
I'm afraid I do not know Perl well enough to say exactly how you would accomplish this, but I would think Perl has some way of using Sockets? If so then that would probably do the trick.
Nov 9 '07 #8
KevinADC
4,059 Recognized Expert Specialist
If the site you want to upload to already has a form you use to upload files, then you can most likely use the WWW::Mechanize module. But if the site uses javascript you can't because WWW::Mechanize does not support javascript. Search CPAN fo the module.
Nov 10 '07 #9
jcor
63 New Member
thanks for your help guys, was really something like WWW::Mechanize what I was looking for. I'll write the script and let you know how it's going.

thanks again,

Joćo
Nov 12 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
6
by: Chamomile | last post by:
can anyone point me to some straightforward information on file uploading without using an html form? That is, direcly from within a php script. if I know the local path etc. to a particular...
4
by: Chris Dewin | last post by:
How do I go about writing a cgi script, that will enable the client to upload things to a directory on my website? I would also like to write a script that enables the client to delete items in...
0
by: Jason Franks | last post by:
Hello again! I play an online text based game and create a list of all the weapons and armour we have. Access works a treat with this! I also have a bad website, but the main thing is...
16
by: B Letts | last post by:
Hi - I'm currently using the FileUpload control to allow people to upload files to my website. This all works fine, as long as I'm going to a physical path on my server. However, I need to...
3
by: Gavin | last post by:
I need some help, I need the code to allow people that visit my website to be able to upload pictures to a file on my web server. I have been able to get close, but not quite there yet. Set fso...
2
by: Erland | last post by:
Hi all, I have developed an asp.net( 1.1) website using vb.net and Microsoft Access and my hosting company does support asp.net1.1. Now I've FTP'd the website , but whenever i try to access the...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
4
by: Rob Meade | last post by:
Dear all, We have purchased a product called SA-FileUp which we have used in our organisation for a number of years, I'm quite an an avid supporter of it, recently I've been trying to ensure...
10
by: =?Utf-8?B?RGFu?= | last post by:
I'm using a pure ASP upload script to handle file uploading. We run IIS6 and I'm aware of the AspMaxRequestEntityAllowed variable in the metabase. I upped this to allow the file size maximum and it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
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...

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.