The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to restore original package after uninstalling the upgraded package using rpm amitpansuria Linux 0 05-27-2008 01:08 AM
Could be a corrupted file? kaugrs HP-UX 1 01-16-2008 08:22 AM
LV corrupted Alfredo Jimenez AIX 1 08-23-2005 05:38 AM
kernerl corrupted art_malabanan SCO 3 09-24-2003 07:45 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-2008
Registered User
 

Join Date: Feb 2008
Posts: 12
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Question .exe package is corrupted

Hi,

First, I wasn't sure if my question is appropriate for this forum. Still, I post here as I have a great respect for the knowledge that flows here.

Below are the details of my web application
File Server - Windows NT (End user files are stored)
Storage type - SAN (Storage area network)
Web server - Apache 2.0.58. on HPUX
Coding - Perl (Uses LWP download for http access)
Note: The files are first downloaded to web server and then users download the same from web server to local machine.

As the upload of user file is through a different tool, there is no visibility on its architecture. My application is used by users to download those files.

I use file <filename> to get the file attributes. I check for types cpio, gz or compress and take appropriate action. If the file is of type .pkg then I do nothing before download.

With the above state, the .exe files that are downloaded are corrupted. I mean they are not the same as the ones that are uploaded. Please help, I can explain more.

Regads
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-11-2008
robotronic's Avatar
Can I play with madness?
 
Join Date: Apr 2002
Location: Italy
Posts: 389
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
It could be possible that your application is downloading files in ascii format instead of binary format.

This is a common mistake while using a ftp client for example.
Reply With Quote
  #3 (permalink)  
Old 05-11-2008
Registered User
 

Join Date: Feb 2008
Posts: 12
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
.exe package is corrupted

No luck :-( My suspision was exactly that; below is the code that I changed to see if that was the cause. I am not very sure what happens with the LWP download (LWP is a perl module). I am not very good in Perl. I learnt Perl for this application.

open(DLFILE, "<$files_location$_[0]") || Error('open', 'file');
@fileholder = <DLFILE>;
close (DLFILE) || Error ('close', 'file');

print "Content-length: $filesize\n";
# print "Content-Type:application/x-download\n";
print "Content-Type:application/binary\n";
print "Content-Disposition:attachment;filename=$_[0]\n\n";
print @fileholder;
Reply With Quote
  #4 (permalink)  
Old 05-11-2008
robotronic's Avatar
Can I play with madness?
 
Join Date: Apr 2002
Location: Italy
Posts: 389
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Quote:
Originally Posted by Nanu_Manju View Post
I am not very good in Perl.
Well, we are in two

I'm sure that someone else in these forums could give you much more help than me on Perl
Reply With Quote
  #5 (permalink)  
Old 05-11-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 2,203
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Are you really supposed to add headers like that smack dab in the file itself? It's a thing commonly done by a server so it might be perfectly okay but if you are adding headers where you're not supposed to, that's pretty sure to destroy the file.
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 03:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102