拉一些文件夹并通过电子邮件发送 [英] Zip some folders and send by email
本文介绍了拉一些文件夹并通过电子邮件发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用大多数网络服务器上的标准php功能 - 我如何将所选文件夹压缩为所有文件夹并将zip文件通过电子邮件发送给自己。
Not作为一个cron工作或任何自动化的东西 - 我将在控制面板中添加
。
解决方案
Krustov写道:
使用大多数网络服务器上的标准php函数 - 我如何
压缩所选文件夹并通过电子邮件发送zip文件对我自己。
不是作为一个cron工作或任何自动化的东西 - 它将是一个选项,我将在控制面板中添加
。
恕我直言,它在shell中比在PHP中容易多了。写一个shell脚本
并用PHP调用它。
类似于:
#!/ bin / bash
RECIP ="
1"
if [-z"
RECIP" ]。然后
echo usage sendzip re*******@test.com file1 file2 file3 ....
fi
zip data。{
Using the standard php functions found on most web servers - how do i
zip selected folders and have the zip file emailed to myself .
Not as a cron job or anything automated - it will be a option i will add
in the control panel .
解决方案
Krustov wrote:
Using the standard php functions found on most web servers - how do i
zip selected folders and have the zip file emailed to myself .
Not as a cron job or anything automated - it will be a option i will add
in the control panel .IMHO its a lot easier to do from the shell than in PHP. Write a shell script
and call it from PHP.
Something like:
#!/bin/bash
RECIP="
1"
if [ -z "
RECIP" ]; then
echo usage sendzip re*******@test.com file1 file2 file3 ....
fi
zip data.{
这篇关于拉一些文件夹并通过电子邮件发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文