したがって、PHP でこれを行う場合は、次のコードを使用します。
<?php
//Filepath is the full url to your file
$filepath="http://www.example.com/examplefile";
//Filename is the name you want to display for the file, even if the files name is "1" you can set the name to be "2"
$filename='Example Name Here';
//The files description:
$filedescription='This is my example file';
//The first line here contains the filetype of the file, so that it can be open correctly.
//This example is .pdf, but you can use other filetypes - as told later on
//This following "block" contains information about the file
header('Content-Type: application/pdf');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=" . $filename);
header("Content-Description: $filedescription");
header("Content-Length: " . filesize($filepath));
//Download the file
readfile($filepath);
?>
ファイルが .pdf でない場合は、さまざまなファイル タイプの完全なリストについては、
http ://webdesign.about.com/od/multimedia/a/mime-types-by-content-type.htm を参照してください。
したがって、ファイルが .jpg の場合、コードは次のようになります。
header('Content-Type: image/jpeg');
それ以外の;
header('Content-Type: application/pdf');
つまり... このスクリプトが行うことは、ブラウザから開くと、ダウンロードしようとしているファイルを取得し、ダウンロードする前に情報を変更することです。ファイルはウェブサーバーまたは(これについては不明ですが)Dropbox アカウントにアップロードできます。
VB コードは次のようになります。
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
//The url should be the one to your .php file
Process.Start("chrome.exe", "http://example.com/example.php")
End Sub
PHPなどに慣れていない場合、これは非常にぼやけている可能性がありますが、恐れることはありません-私がお手伝いします! 何か問題があればコメントしてください;)