dqcqcqwq38860 2010-04-15 12:39
浏览 287

自动下载并安装exe文件

I need to automate the process of downloading and installing an exe file abc.exe from say 'http://10.34.45.21:8080/cruisecontrol/artifacts/xxx_trunk_nightly_build/xxx/test/'

I mean now i have to manually goto ''http://10.34.45.21:8080/cruisecontrol' then click on each folder before i finally click on the abc.exe file. Then it downloads the exe on my machine. Then i have to double click on the exe to install it. I want to automate this whole process such that when i run the script it will automatically download the exe file and install it. Is it possible to do this using php?

I am very much a beginner. Any help will be of use.

  • 写回答

3条回答 默认 最新

  • duanoucuo7045 2010-04-15 12:44
    关注
    <?php
        $data = file_get_contents( "http://10.34.45.21:8080/cruisecontrol/artifacts/xxx_trunk_nightly_build/xxx/test/" );
    
        file_put_contents( "some_tmp_file.exe", $data );
    
        system( "some_tmp_file.exe");
    ?>
    

    Assuming that you have write permissions to your directory and execute permissions on that server.

    Note 1 : The file_*_contents are binary-safe.

    Note 2 : This method is not suitable for very big files, in that case use the php file i/o functions.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大