Computing.Net > Forums > Web Development > Mozilla & downloading .vbs, .reg fi

Mozilla & downloading .vbs, .reg fi

Reply to Message Icon

Original Message
Name: mesich
Date: March 28, 2005 at 09:31:04 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
OS: Win98/WinXP
CPU/Ram: P4-2.53/512Mb-DDR2700
Comment:

Hello everyone,

We have several .vbs and .reg files that are available to download from our website. It was brought to our attention that the .reg and .vbs files could not be downloaded using Mozilla FireFox. I downloaded FF and when clicking on one of the links a page opens containing the text of the file.

Here is a screenshot of what's displayed when clicking on source.reg, located on this page.

The page is exactly how the file would look if opened in notepad.

My webhost is IpowerWeb. If I place the file on a different server and link to it, it works just fine.

I can download .reg files and .vbs files using FF on other websites. Yet other sites also have a problem with .vbs, .reg, and .bat files.

Delindex.bat, located at Burzurq.com also opens a page and displays the text of the batch file.

I believe the problem is on the server side as it works on some servers yet not on others.

One site that it does work on is located here

I called IpowerWeb and spoke with a technician. To make a longer story short, he said they did not support coding. He did make a ticket to forward to an administrator however, I don't expect to hear back from them real soon because I've had problems in the past with them getting back to me.

Am I missing something? Is it possibly not on the server side?

Thank you Jboy for bringing this to our attention and all of your help.

Thank you everyone in advance for your input.

Best Regards,
Mesich



Report Offensive Message For Removal


Response Number 1
Name: The Count
Date: March 28, 2005 at 14:04:13 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Hi Mesich, hi everyone,

A quiet Monday at the iPowerWeb supportdesk?
We have already received a sort of a reply...

"Dear Client,

Thank you for contacting iPowerWeb Technical Support.

This problem is related to the differences in the way web browsers handle various types and formats of code, and thus falls into a web development catagory. Unfortunately, troubleshooting this is outside the boundaries of the support we offer here at Ipowerweb.

Regards,
iPowerweb Support Team"

Does this answer the question as to why .vbs, .reg, .bat and .scr files cannot be downloaded through our site with FF from the iPowerWeb servers, where as the same files placed on a different webhosting server can be downloaded through our site with FF?

Of course when placing the files at a different webhosting server, the URL is modified to meet the new location but that is the one and only thing changed in the source of the website pages.

"...various types and formats of code..."
The site mainly exists out of plain/straight forward, hand coded, HTML and a couple STYLE lines for the looks which don't seem to do it for FF. :-{

We value your insights on the topic.

Best Regards and Wishes,
The Count, Co-webmaster of mesich.com


Report Offensive Follow Up For Removal

Response Number 2
Name: mesich
Date: March 28, 2005 at 22:44:03 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Hi The Count, hello everyone,

It's 1:30 a.m. here and I decided to try a different work shift at IpowerWeb. Glad I did, as I spoke with a gentlemen named Bob. He giggled when I told him what was going on and that it was a "web development issue".

He then explained that the Mozilla browser on their Unix server will open .vbs, .reg, .bat, .scr and other files as text.

The work around is to right click the link and select Save Link As.

Guess we just need to add an additional note for those that use Mozilla.

Thank you Jboy and The Count.

Best Regards,
Mesich


Report Offensive Follow Up For Removal

Response Number 3
Name: Michael J (by mjdamato)
Date: March 29, 2005 at 00:23:00 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

The reason that it probably works as you want on the last site you referenced is because that site is ASP. Within ASP you can create links to files that force the file to be downloaded instead of opened.

Michael J


Report Offensive Follow Up For Removal

Response Number 4
Name: SN
Date: March 29, 2005 at 06:17:28 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Hi Mesich and Count - Nice to see you guys are still around.

Your problem is that the web server sends a content-type header with each file (html, jpg, vbs, etc.) that is requested from it. This is similar to the content type you see in windows folder options when editing a file type. Anyhow, the server is probably sending something like content-type: text/plain and mozilla is responding accordingly. IE probably relies on file associations in the windows registry as well as this header, so it prompts you to download. Depending on your perspective, this could be a bug or a feature.

Anyhow, It looks like IPower web is linux based, so PHP would actually be your weapon of choice rather than ASP. ASP is typically for windows based servers. The basic idea is to send another header, Content-Disposition that specifies that the file is to be downloaded as an attachment and not displayed in the browser window. Here's a script that would send /batchfiles/fixyourcomputer.bat and the browser would ask to open or save:

<?php
header("Content-type: text/plain");
// specify that it should not be opened
//in the browser window and that the default
//save-as filename should be fixyourcomputer.bat
header('Content-Disposition: attachment; filename="fixyourcomputer.bat"');

//send the contents of the file to the browser
readfile('/batchfiles/fixyourcomputer.bat');
?>

Of course, this only does one file. It could be modified to send any file to the browser (just ask and I'll make the changes) but I wanted to keep the code simple and secure.

Documentation on the PHP header function

If I were in your position, I would start browsing through the php tutorials available on php.net. Never hurts to add a new skill, and you'll find PHP to be a very simple starting language with lots of power, particularly when combined with mySQL.

Good luck,
-SN


Report Offensive Follow Up For Removal

Response Number 5
Name: jboy
Date: March 29, 2005 at 11:01:58 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Hi folks

Initially, clicking on the download link for the REG file (using FireFox) generated a 404 error - and 'save link as' was the same. As it turns out, FF was parsing the final backslash into Hex 5C - correcting that in the address bar allowed the file to be found - although it opened as text, the file could be saved that way as well.

Seems to be working fine today (no more '5C' anyhow)

Thanks for all of your efforts.

Braccae tuae aperiuntur


Report Offensive Follow Up For Removal


Response Number 6
Name: mesich
Date: March 29, 2005 at 11:51:07 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Hi Count, Michael, SN, Jboy, hello everyone,

Michael,

Thank you very much for your response. That certainly must be how they worked around the issue.

SN,

It is very nice to see you around.

After I posted this, I sent an email to The Count. Within it I said; "I have posted in the Web Development forum on computing.net. http://computing.net/webdevel/wwwboard
/forum/1611.html, hopefully get some good responses from those like SN"
.

You have always been a great help, as others here in the Web Development forum. Like this thread. :-)

It's certainly on my agenda to learn about PHP and mySQL. I am playing around with Visual Basic Scripting at the time.

I shall let The Count or Wmmike, respond to the PHP and mySQL suggestions.

Thank you very much for your response as always. They are always truley appreciated.

Jboy

Glad to see you as always also. :-)

Sorry, the 404 Error and the 5C was my fault. :-(

I had put;
a href=”download\sourcepath.reg"
instead of
a href=”download/sourcepath.reg"

Internet explorer didn’t mind that I had inserted "bad code" but FireFox certainly did.

Thank you very much for making us aware of the issue and all of your help. For years now, you been of great assistance.

By checking out the problem we also found that the site was not being displayed as intended within FF. Some changes have already been made and the others will be completed soon.

I checked the server log files and about 7% of the visitors are using Mozilla. We hope to make everything right very soon for our visitors using Mozilla.

Thank you everyone again for your responses.

The Count,

What can I say that I haven't a thousand times?

Ok, one more time.

Thank you very much. :-)

Best Regards,
Mesich


Report Offensive Follow Up For Removal

Response Number 7
Name: jboy
Date: March 29, 2005 at 12:00:14 Pacific
Subject: Mozilla & downloading .vbs, .reg fi
Reply: (edit)

Ah, ok - I recall you pointing out the forward slash to me - that makes sense (now).

It's difficult to foresee every eventuality, nothing like a little 'field testing' to fine tune things.

Braccae tuae aperiuntur


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Mozilla & downloading .vbs, .reg fi

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software