Skip to content

Commit

Permalink
保存的媒体文件权限设置为0644
Browse files Browse the repository at this point in the history
  • Loading branch information
hexsum committed Apr 19, 2018
1 parent 340f74b commit 65acadf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Mojo/Weixin/Message/Remote/_get_media.pm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ sub Mojo::Weixin::_get_media {
}
eval{
open(my $fh,">",$path) or die $!;
chmod 0644, $fh;
print $fh $data;
close $fh;
$msg->media_path($^O eq 'MSWin32'?Encode::encode("utf8",Encode::decode("gbk",$path)):$path);
Expand All @@ -137,6 +138,7 @@ sub Mojo::Weixin::_get_media {
eval{
my $tmp = File::Temp->new(@opt);
binmode $tmp;
chmod 0644, $tmp;
print $tmp $data;
close $tmp;
$msg->media_path($tmp->filename);
Expand Down

0 comments on commit 65acadf

Please sign in to comment.