473,699 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
+ 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 1714
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
2775
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 4.2. 3, not in safe mode. I think that the basic problem is the set-up for the temp folder, but I don't have access to the .ini settings. I'm pretty sure it's possible, because I've got MyPHPAdmin running, and
6
2824
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 requested file how can I send it directly to a location on a remote webserver following a request from the remote server? The motivation is that I have a large number of image files that are
4
2662
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 that directory if they want. Given that it's unix server, how do I go about ensuring the files are written to that dir with the right permissions?
0
1132
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 somewhere to link the armoury from.(site improvements very soon) However I have been uploading the report for a while, but since the June 1st I have been unable to update the site. I hope it is not something I am
16
11783
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 allow people to upload to a virtual directory. The directory may or may not exist on the same server as the Web site. I can't seem to figure out how to do this. If I pass the virtual
3
2307
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 = createobject("scripting.filesystemobject") Set act = fso.CreateTextFile(server.mappath("test.jpg"), true) act.WriteLine act.Close The above code will create the file but will not write any data in it. Below
2
1568
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 website using www.domainname.com/application_folder_name/index.aspx ( where index.aspx is first page of my application) I get the following error ----------------------------- Runtime Error
5
2721
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 more documents to share/use during a meeting presentation. What would be the most efficient way to approach this? This is the logic I'm currently considering: Page 1: Meeting Information input with link to a document upload page (this page...
4
1388
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 some of our older applications which used native .Net uploading moved across to our .Net implementation of SA-FileUp. Because there is development time involved in this I have now been asked by my manager to "test" both native and SA techniques to...
10
8082
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 was working for the past couple months. Now all of a sudden in the past couple of days we are seeming to have problems. The upload works fine for anything up to around 2mb (or so it seems). When uploading about 20mb worth (10x2mb files), I...
0
8694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8928
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
8890
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5877
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
4379
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
4634
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3060
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
2
2355
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2013
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.