Re^3: perl program for importing files on local system
by marto (Cardinal) on Jan 28, 2009 at 13:46 UTC
|
Hi rahulgsp83,
If I understand you correctly you have some sort of CMS system that runs on a server that users access via a browser? Or does "perl/cgi which is really on client side only" mean that this system installs on client machines?
If this actually runs from a server then there are many posts here regards file uploading, for example Re: I need a simple web upload script. (super search for more examples).
Martin
| [reply] |
|
|
Hi Martin,
thanks for ur replies,i think i am not able to describe the reqs properly,let me try once again
suppose user has got access to some CMS through URL,he is working on it ,now he wants to import a file from his local system into the "cms" in which he is working ,(there is no network transfer stuff involved here ,we are already connected to network through VPN),i have developed a button ,if we click the perl program is called now only program is that when that perl program executes "some thing"(i dont no wit) should happen through which user is able to transfer files (just as he would do on his WINDOWS LOCAL MACHINE),hope i am able to describe this time
nyways thanks to all the ppl for replying ,i am also trying from end to solve this issue
regards,
rahul
| [reply] |
|
|
rahulgsp83,
You need to display an HTML form with a file input element, this will allow the user to select a file from their local machine. On the server you need to have a script to accept the form input, and upload the file. Look again at the sample html form, and the perl script which processes the form and uploads the file in Re: I need a simple web upload script. (forget about the email section of this example, it's not required for what you are trying to do).
Martin
| [reply] |
|
|
Bear in mind that your cms is what executes the perl script, *not* the user, in the scenario you described. Hence, the user uploads some file to the server, the server does something cool, then the web page with the response is displayed on the user's browser.
| [reply] |
|
|
Hi Marto,
thanks for replies ,actually i think mistake is mine i am probably not clear in description of requirements ,let me try once again ,
users are accessing server thr browser only ,supppose we are USING that CMS,now some one wants to IMPORT a file which is on HIS LOCAL SYSTEM inside the CMS ,there is no UPLOAD required here as per my unstding of that CMS,we just need to import the file through a perl/SCRIPT which will be launched when we click a button inside the CMS ,i have developed that button but when i am not able to write the perl/CGI script which wll execute when the user hits a button and "something" will happen through which user will select files on local system and import it within server
i am not sure i am still clear or not but still thanks for ur earlier replies
regards,
rahul
| [reply] |
|
|
Hi rahulgsp83,
I think that this explanation is much clearer, did you look at the code in the link I provided in my previous post? You could set this up as an example on your server to see how it prompts users to for a file to upload from their local machine to a server. Once you are happy with how that is working you could either integrate the functionality with the existing CMS code, or maintain this as a separate script.
Hope this helps,
Martin
| [reply] |
|
|
Your understanding of the word 'import' is incorrect.
I import when *I* take a file from somewhere and (usually) load it to some environment. A network connection is not implied. Example usage: I imported a log file into my spreadsheet program.
I download when *I* transfer a file from somewhere to a local file system over a network connection. Example usage: I downloaded the perl module from CPAN.
I'm not trying to be the language police, but your use of caps lock on words that don't fit, combined with gradually explaining the problem post by post instead of up top where it belongs, doesn't help. As it stands now, all your users are importing local files into a local cms system on their local server, because there is no upload (and as such, no download) taking place.
| [reply] |