Facing issues with Content-Type:application/x-download Content-Disposition:attachment

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Facing issues with Content-Type:application/x-download Content-Disposition:attachment
# 1  
Old 05-21-2013
Facing issues with Content-Type:application/x-download Content-Disposition:attachment

I am in the process of developing a perl cgi page.
I had succeeded in developing the page but there are few errors/issues with the page.

description about cgi page:

My CGI page retrieves all the file names from an directory and displays the files in drop down menu for downloading the required file.
Error 1:
Content-Type:application/x-download Content-Disposition:attachment;filename= 
is displayed on the screen

Error 2:
I am able to display the dropdown box and my drop down doesnt contain anything. It failed to retreive the files from the directory.
But if I make the seperate code for this.... it worked.
     If placed in my cgi program  not able to get the files.

I have attached the screenshots of the web page.
And also attaching the complete code.

Could you please let me know how to come out of this issues.

Tons of thanks....!!!

# 2  
Old 05-24-2013
I think you ended your header too soon with "\n\n". Perhaps you meant "\r\n", so later when you term the http header, use "\r\n\r\n".
# 3  
Old 05-27-2013
Thanks DGPickett ...

I tried with the change that you had suggested but no luck .....


Content-Type:application/x-download Content-Disposition:attachment;filename=

was printed directly on the webpage.

Could you please let me know what went wrong ....
# 4  
Old 05-27-2013
Can you try checking the value of $ID before using it.
This User Gave Thanks to shreedhar.rk123 For This Post:
# 5  
Old 05-27-2013
thanks shreedhar....

I had placed few excel files in a folder and trying to catching the files in select tag in cgi perl.

But I am not able to capture the files in select-options dynamically.
files are stored in array. If I print the array( @files : files are stored into this array ) all the file names are displayed on the webpage.

not sure what went wrong.. trying to solve this issue since 5 days but no luck..
Facing issues with Content-Type:application/x-download Content-Disposition:attachment-errorpng
# 6  
Old 05-27-2013
i ask you to check below few things:

"C:\\Program Files\\Apache Software Foundation\\Apache2.2\\reports\\";
"c:/Program Files/Apache Software Foundation/Apache2.2/Reports/";

* check the // \ in the above path names.

open(DLFILE, "<$files_location/$ID") || Error('open', 'file');
@fileholder = <DLFILE>;

*Check the above line once wat is the acutal o/p?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mailx with attachment and html content

Hi, Please see my code below i'm trying get an email send with attachment and html content in the body. Using the code below will put the encoding for attachment in the body as well SUBJECT="$(echo "XPI Monitoring "${tcnt}" transactions waiting \nContent-Type: text/html")" cat... (3 Replies)
Discussion started by: bhoshan
3 Replies

2. Shell Programming and Scripting

Content of attachment is displaying along with subject in mailx

Hi All, I want to send the csv to an email address. I have tried the below two approaches. Approach1: Got error -ksh: uuencode: not found $ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv -ksh: uuencode: not found Approach2:... (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies

3. Shell Programming and Scripting

Format of content displayed in the attachment of email

Hi, I'm facing a problem in mailing attachments using uuencode in mailx. I got to attach a couple of flatfiles. I'm able to attach and mail the files successfully. But there is a problem in the format of the flatfiles when they are received as an attachemnt. For Example : Consider... (0 Replies)
Discussion started by: Sindhuap
0 Replies

4. Shell Programming and Scripting

Determine Content-Type

I am limited to using only libraries that come with the default install of ActivePerl. I'd like to be able to determine the content type of a file on the fly. I thought CGI.pm might do it, but it looks a little weird to me from the perldoc. If someone has a quick way to determine the type of... (4 Replies)
Discussion started by: mrwatkin
4 Replies

5. Shell Programming and Scripting

Remove specific pattern header and its content problem facing

Discussion started by: patrick87
8 Replies

6. Shell Programming and Scripting

Check file content type

I have a shell script that takes a file and uses "syncsort" to sort contents. I want to add a condition to check whether the input file is textual or binary format. If textual, the "syncsort" will be used to sort the files contents. Otherwise, the sorting process will be skipped. Note that the... (3 Replies)
Discussion started by: synthea
3 Replies

7. Shell Programming and Scripting

how to send an email with some body content and attachment

hi plz help me in sending a mail with some data in body and an attachment as some txt file. currently i am able to send mail with some body content, i need an example how to send the same along with attachment. thanks in advance -bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

8. Shell Programming and Scripting

Web content download

There is a web API https://pi.ercot.com/contentproxy/publicList?folder_id=10001937 As soon as this is fired on the browser a page comes in which many files are listed for downloads I want to download all the files ....is it possible to write a shell script which can download the files (1 Reply)
Discussion started by: viv1
1 Replies

9. UNIX for Dummies Questions & Answers

is there a content type command?

Hi I run on a Unix webserver at my university. I have a couple of *.inc files which are include files used for php. They are all in one folder without an index file. If you go to the folder, you get to see a list of files in that dir. Some of the .inc have a question mark icon next to... (3 Replies)
Discussion started by: aqh2
3 Replies

10. UNIX for Dummies Questions & Answers


hey.. found out what was wrong. didnt have Read permission of the file for others LOL. But yeah the C version of it, why does it work in Netscape and not IE? primal ----- Hey everyone! Has anyone run into this before... I'm creating a UNIX CGI program that will parse $QUERY_STRING and save... (1 Reply)
Discussion started by: primal
1 Replies
Login or Register to Ask a Question

Featured Tech Videos