Sponsored Content
Full Discussion: Downloading Excel File
Top Forums UNIX for Dummies Questions & Answers Downloading Excel File Post 302158300 by matrixmadhan on Tuesday 15th of January 2008 02:25:16 AM
Old 01-15-2008
Downloading Excel File

Hello All,

Currently working with CGI scripts in perl which involves
a) uploading
b) processing
c) downloading the file back to the user

uploading and processing quite trivial and they are done

Third part is kind of being tricky.
Excel file in binary format is getting displayed in the html page itself and not popping up a download window for downloading file to the client's machine

Code snippet
Code:
my @fileholder;

open(EXCLFILE, "<", $file_path) or die "Unable to download file $file_path\n";
 binmode EXCLFILE;
 @fileholder = <EXCLFILE>;
close (EXCLFILE);

print "Content-Type:application/vnd.ms-excel\n";
print "Content-Disposition:attachment;filename=$file_path\n\n";
print @fileholder;

Any pointers to proceed with this is much appreciated.

Thanks Smilie

Last edited by matrixmadhan; 01-15-2008 at 12:43 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Downloading a csv file automatically

I want to automatically download a CSV file daily which can be found here: London Stock Exchange - Search and the link is named "Click to download covered warrants (100Kb)" on the right hand side. What commands can I use to invoke clicking on this link and initiating the download? And also... (2 Replies)
Discussion started by: figaro
2 Replies

2. Shell Programming and Scripting

Downloading file from internet

Hi, I need to write a script to download a file (say http: //www.mysite.com/myfile.txt) from the internet (please note that the file is on http not ftp). Please let me know if there is any method other than wget. Thanks, Chetan (4 Replies)
Discussion started by: chetanpc
4 Replies

3. Shell Programming and Scripting

File downloading

Hi, I am newbie in Perl/CGI and I need your help to develop a little script to help me to download some files located in a FTP server via HTTP to a disk. I need to authenticate with username/password via a HTTP page and I can choose the files to download from the web page to my disk. Can... (2 Replies)
Discussion started by: imad77
2 Replies

4. Shell Programming and Scripting

File downloading help in perl

Im trying to write a perl code to do the following task. I have a website which is located in a diffirent country. I want to download a file from that site everyday. The file name keeps on changing everyday. say the file name is CTP-latest-5.3.0.37.iso next day it may change to... (0 Replies)
Discussion started by: srijith
0 Replies

5. Shell Programming and Scripting

Writing excel file using perl : Excel file formatting changed

I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed. What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies

6. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

7. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

8. Shell Programming and Scripting

Downloading file from mainframe to UNIX

Hi All , I need a help regarding file ftp ing from mainframe to unix.Our source file is mainframe file.I need to download the mainframe file to local unix server through unix script.If anyone can help me how we can do it through unix script ,it will be really helpful.Thanks. (7 Replies)
Discussion started by: STCET22
7 Replies

9. Shell Programming and Scripting

How to check if downloading of a file is completed?

Hello All. We are getting one zip file from another server daily. The size of the zip file will be around 4.5 gb that takes time to download completely. I have to process that file furthest once get downloaded completely. I have written one code for that, but i need suggestion whether it is a... (7 Replies)
Discussion started by: looney
7 Replies

10. UNIX for Beginners Questions & Answers

File downloading

I saved to disk using lynx, under ls it shows up but no matter what I have done back comes the statment no such file. How do you erase these ls false readings or open what ls shows? (9 Replies)
Discussion started by: Jackbird
9 Replies
BK(4)							     Kernel Interfaces Manual							     BK(4)

NAME
bk - line discipline for machine-machine communication (obsolete) SYNOPSIS
Not currently supported under 2.11BSD DESCRIPTION
This line discipline provides a replacement for the old and new tty drivers described in tty(4) when high speed output to and especially input from another machine is to be transmitted over a asynchronous communications line. The discipline was designed for use by the Berke- ley network. It may be suitable for uploading of data from microprocessors into the system. If you are going to send data over asynchro- nous communications lines at high speed into the system, you must use this discipline, as the system otherwise may detect high input data rates on terminal lines and disables the lines; in any case the processing of such data when normal terminal mechanisms are involved satu- rates the system. The line discipline is enabled by a sequence: #include <sgtty.h> int ldisc = NETLDISC, fildes; ... ioctl(fildes, TIOCSETD, &ldisc); A typical application program then reads a sequence of lines from the terminal port, checking header and sequencing information on each line and acknowledging receipt of each line to the sender, who then transmits another line of data. Typically several hundred bytes of data and a smaller amount of control information will be received on each handshake. The old standard teletype discipline can be restored by doing: ldisc = OTTYDISC; ioctl(fildes, TIOCSETD, &ldisc); While in networked mode, normal teletype output functions take place. Thus, if an 8 bit output data path is desired, it is necessary to prepare the output line by putting it into RAW mode using ioctl(2). This must be done before changing the discipline with TIOCSETD, as most ioctl(2) calls are disabled while in network line-discipline mode. When in network mode, input processing is very limited to reduce overhead. Currently the input path is only 7 bits wide, with newline the only recognized character, terminating an input record. Each input record must be read and acknowledged before the next input is read as the system refuses to accept any new data when there is a record in the buffer. The buffer is limited in length, but the system guarantees to always be willing to accept input resulting in 512 data characters and then the terminating newline. User level programs should provide sequencing and checksums on the information to guarantee accurate data transfer. SEE ALSO
tty(4) DIAGNOSTICS
None. BUGS
The Purdue uploading line discipline, which provides 8 bits and uses timeout's to terminate uploading should be incorporated into the stan- dard system, as it is much more suitable for microprocessor connections. 4th Berkeley Distribution January 27, 1996 BK(4)
All times are GMT -4. The time now is 04:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy