473,748 Members | 2,207 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 1719
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
2778
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
2825
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
2667
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
1135
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
11792
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
2313
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
1570
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
2727
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
1392
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
8090
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
8991
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...
0
8831
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,...
0
9376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9249
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
8245
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
6796
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
6076
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
4607
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...
1
3315
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

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.