LaneWeChat

PHP微信开发框架,高效开发微信公众号应用。简洁而又轻量

GitHub下载 查看手册

多媒体上传下载

Visits: 14550 Date: 2014-08-20 17:30:07 Power By 李轩Lane

    

1、类简介:在网页中获取来访用户的数据。上传的多媒体文件有格式和大小限制,如下:

            * 图片(image): 1M,支持JPG格式

            * 语音(voice):2M,播放长度不超过60s,支持AMR\MP3格式

            * 视频(video):10MB,支持MP4格式

            * 缩略图(thumb):64KB,支持JPG格式

            * 媒体文件在后台保存时间为3天,即3天后media_id失效


        2、使用命名空间:use LaneWeChat\Core\Media;


        3、参数  $filename 上传的文件的绝对路径

                $type 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)

                $mediaId = "通过上传多媒体文件,得到的id。";

                $groupId = '分组ID';                         在添加新分组、获取分组列表的时候可以得到


        4、上传:上传后,微信服务器会返回一个mediaId。

            Media::upload($filename, $type);


        5、下载:根据mediaId下载一个多媒体文件。

            Media::download($mediaId);


Reply: zuiweng518 On 2015-04-14 08:56:39

微信公众号里边用户上传的语音,不是通过网页上传,而是通过聊天窗口上传的语音怎么保存到自己的服务器上

回复

Reply: Lane On 2015-04-17 16:48:26

被动响应的时候微信服务器会给你推送一个语音。任何一个文件的本质都是二进制,你可以保存或者做其他的处理。

回复

Reply: Root On 2015-04-24 22:55:58

上传图片没有mediaid返回式什么原因 如 $filename='http://static.clewm.net/cli/images/logo1225.png'; $mediaId = Media::upload($filename, 'image'); 用法错误?

回复

Reply: buxulianxiang On 2015-05-08 11:15:45

Media::upload('F:\php\weixin\222.jpg', 'image'); 返回的是{"errcode":41005,"errmsg":"media data missing"} 这是什么原因造成的呢

回复

Reply: Lane On 2015-06-16 10:29:05

php5.5以上要使用CURL_FILE()的类来上传。

回复

Reply: wordyhuang On 2015-08-04 14:38:17

把源码中的 $data['media'] = '@'.$filename; 改成:$data['media'] = new \CURLFile($filename); 就行了的。

回复

Reply: jun_6 On 2015-09-16 10:13:23

为何没有这个CURLFile

回复

Reply: myjf007 On 2015-06-08 20:53:06

上传成功后,在微信公众平台后台并没有看到上传的图片啊

回复

Reply: hansoy On 2015-11-23 22:42:43

确实在后台没看到,这个应属于“临时素材”,后台无法看到

回复

Reply: fu chenlou On 2015-08-07 19:15:27

音频如何下载保存成mp3格式

回复

Reply: chenyang On 2016-08-09 02:06:53

可以同步吧客户发的照片上传到七牛么

回复

Reply: 小塔 On 2016-08-25 15:25:16

上传的永久素材应该调用哪个接口?还是没有实现这个?

回复

Reply: Owereemiz On 2020-06-17 10:18:01

Rouitne Doses Of Amoxicillin https://agenericcialise.com/ - generic cialis release date Efectos Secundarios De Cialis <a href=https://agenericcialise.com/#>cialis 5mg</a> Cialis En Exceso

回复

Reply: buy cialis online reviews On 2020-08-23 02:58:20

Cheap Generic Propecia Cialis Online Lelefuerse https://apcialisz.com/ - cialis without a doctor's prescription tumjuptImpam Viagra Rezeptfrei Kaufen Billig irralymN <a href=https://apcialisz.com/#>canadian pharmacy cialis</a> goormapoge Keflex Reaction

回复

Reply: Pam On 2020-10-04 20:35:14

order cialis for daily use reviews cialis online cialis 5 mg online cialis take effect does cialis work on females

回复

Reply: Angela On 2020-10-07 23:29:41

sito sicuro viagra generico comprar viagra generica online viagra prescription viagra expiration prescription viagra online uk

回复

Reply: Kmrfisona On 2020-11-08 05:35:38

cheapest generic viagra prices online http://usggrxmed.com/ <a href="http://usggrxmed.com/#">generic viagra online</a> generic sildenafil vs viagra

回复

Reply: Jildcisona On 2020-11-10 01:59:37

marley drug generic viagra http://fmedrx.com/ <a href="http://fmedrx.com/#">how to order viagra online</a> online prescription viagra

回复

Reply: JivhApery On 2020-11-16 21:05:26

prix viagra pfizer france <a href="https://purevigra.com/#">viagra kaufen in der schweiz</a> women viagra wiki

回复

Reply: Kmrfprot On 2020-11-17 20:22:28

price viagra pfizer <a href="https://purevigra.com/#">https://purevigra.com/</a> how long does it take for viagra 100 mg to work

回复

Reply: DevkAlado On 2020-11-18 19:11:33

viagra in india price <a href="https://paradiseviagira.com/#">generic viagra australia buy</a> professional viagra

回复

Reply: Fbsgisona On 2020-11-20 01:06:59

viagra tablets for sale uk <a href="https://buybuyviamen.com/#">efectos colaterales viagra</a> whats better levitra or viagra

回复

Reply: Fhsbisona On 2020-11-20 19:09:11

viagra prix pharmacie paris <a href="https://buybuyviamen.com/#">buybuyviamen.com</a> chinese brand viagra

回复

Reply: JsweApery On 2020-11-24 18:36:25

viagra prescription cost <a href="https://mygoviagar.com/#">generic viagra online australia</a> viagra prescription online canada

回复

Reply: DbsfAlado On 2020-11-26 16:40:13

buy sildenafil india online <a href="https://lightvigra.com/#">sildenafil 100 mg tablets coupon</a> generic viagra online usa

回复

Reply: FdbvAlado On 2020-11-26 17:02:46

where to buy viagra online in india <a href="https://hopeviagrin.com/#">viagra for women buy online</a> buy female viagra in india

回复

Reply: Fmsgisona On 2020-11-27 23:11:15

kadД±nlarda viagra kullanД±mД± <a href="https://siviagmen.com/#">long viagra shelf life</a> give my dog viagra

回复

Reply: JgscApery On 2020-11-29 23:53:05

essay writing scaffold <a href="https://thesisbyd.com/#">research proposal dissertation</a> analysis essay writing

回复

Reply: Fsfisona On 2020-11-30 23:19:29

writing essay on terrorism <a href="https://essayhelpbgs.com/#">personal essay writing</a> homework charts

回复

Reply: Kwgdprot On 2020-11-30 23:39:41

writing an academic essay <a href="https://researchpaperssfk.com/#">college essay guy activities</a> criminology dissertation

回复

Reply: Ftghisona On 2020-12-01 15:54:36

creating a thesis statement for a research paper <a href="https://thesiswritinghelpsjj.com/#">homework help history</a> research paper depression

回复

Reply: Fqfisona On 2020-12-02 01:23:17

writing an argument essay <a href="https://essaywritingservicesjy.com/#">write an article review</a> homework service

回复

Reply: Fnrhisona On 2020-12-02 11:12:20

viagra fro sale <a href="https://genqpviag.com/#">viagra on line australia</a> price of viagra in india

回复

Reply: Fnrdisona On 2020-12-04 09:28:58

buy viagra soft no prescription <a href="https://llviabest.com/#">substitute for viagra</a> buy generic viagra online in uk

回复

Reply: JgsvApery On 2020-12-11 11:44:45

viagra on lines <a href="https://atviagrmenrx.com/#">london drugs viagra</a> viagra pills in ilkeston

回复

Reply: DvncAlado On 2020-12-11 14:51:55

does generic cialis work <a href="https://vipmenciall.com/#">best price for cialis 20 mg</a> order cialis no prescription

回复

Reply: FgnsAlado On 2020-12-11 15:03:22

free sample of cialis <a href="https://tadafcialirx.com/#">purchase cialis online cheap</a> generic cialis with dapoxetine

回复

Reply: Khedprot On 2020-12-12 13:28:25

trusted ed medical viagra <a href="https://buyviagrrxon.com/#">how to buy viagra</a> viagra for sale in ireland

回复

Reply: Fqbfisona On 2020-12-12 14:14:05

where to find cheap cialis <a href="https://gocialirx.com/#">cheap generic cialis</a> cialis 20mg

回复

Reply: DvnjAlado On 2020-12-16 13:14:01

viagra <a href="https://hopeviagrin.com/#">viagra over the counter stores in vancouver canada</a> viagra strengths

回复

Reply: FhsnAlado On 2020-12-16 13:33:33

how to puchase viagra in canada <a href="https://lightvigra.com/#">purchase viagra melbourne</a> generic viagra suppliers

回复

Reply: Jtmfisona On 2021-01-09 10:34:30

mexican pharmacy online <a href="http://canadadrugsonlinevbyh.com/#">best canadian pharmacy</a> pharmacy today

回复

Reply: Fwsxisona On 2021-01-09 20:32:08

24 hours pharmacy <a href="http://canadapharmacyliiu.com/#">board of pharmacy</a> ed pills that work quickly

回复

Reply: NllpAlado On 2021-01-10 22:57:07

family pharmacy <a href="http://pharmacy-onlineasxs.com/#">corner drug store</a> pharmacy prices

回复

Reply: JlloApery On 2021-01-11 23:38:17

pharm <a href="http://canadianonline-pharmacydazc.com/#">drug store news</a> canadian online pharmacies

回复

Reply: FgvdAlado On 2021-01-12 22:54:41

canada rx pharmacy <a href="http://canadapharmacyonlinestbh.com/#">drug store news ce</a> discount rx

回复

Reply: Klioprot On 2021-01-14 20:35:34

viagra super force <a href="http://bestviagrx.com/#">viagra without perscription</a> buy viagra no prescription overnight shipping cheap real viagra <a href="http://viarxhd.com/#">buy oral viagra online</a> discussion on viagra free viagra online in canada <a href="http://viagetpill.com/#">female viagra uk</a> viagra action women buy viagra brisbane <a href="http://pillexrx.com/#">viagraforsale</a> viagra generics canada ordering viagra through paypal <a href="http://usggrxmed.com/#">viagra sale in malaysia</a> quick ship viagra

回复

Reply: NlbxAlado On 2021-01-15 02:32:03

.buy viagra <a href="http://viashoprx.com/#">viagra australia free</a> buy viagra with paypal canada pfizer viagra online <a href="http://xviagarrx.com/#">grapefruit juice with viagra</a> viagra and cialis buying viagra in ebay <a href="http://viagraviagria.com/#">buy generic viagra online usa</a> lowest price for generic viagra does viagra work on women <a href="http://asgenviagria.com/#">grapefruit viagra interaction</a> viagra generico viagra gold <a href="http://viagengen.com/#">who has the best deal on viagra generic</a> viagra in dubai

回复

Reply: JvcxApery On 2021-01-15 22:49:34

viagra coupons printable <a href="http://fmedrx.com/#">viagra inside inida shipping</a> testimonials of viagra users how much does viagra cost with insurance <a href="http://edabcrx.com/#">online viagra 2 day shipping</a> viagra without a prescripton viagra for sale in the uk <a href="http://abcrxmed.com/#">dizzy right after viagra</a> buy strong viagra viagra buy cheap <a href="http://cialedrx.com/#">generic viagra pills</a> tesco online viagra viagra australia mastercard <a href="http://hitrxmenvia.com/#">viagra act</a> viagra super force 100mg 60mg pills

回复

Reply: FgnhAlado On 2021-01-17 01:30:08

viagra super active online <a href="http://ltdviagragogo.com/#">prescription viagra</a> watch a viagra erection viagra dosage mg <a href="http://hdgenericviagraxk.com/#">buy viagra without a prescription</a> buying viagra viagra with dapoxetine canada <a href="http://buygenericviarga.com/#">viagra malaysia</a> free viagras samples viagra for sale in florida <a href="http://buyhdpillvia.com/#">where can i buy viagra online</a> viagra websites buy viagra in canada <a href="http://genericviagrix.com/#">overnight me viagra</a> viagra cialis on line parmacy

回复

Add Comment
©2014 lanewechat.lanecn.com , All rights reserved. Power By LaneWeChat 微信PHP开发框架.  京ICP备14005030号-1