以编程方式上传文件 [英] uploading a file programmatically

查看:79
本文介绍了以编程方式上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web表单,可用于将文件上传到我们的服务器.我还尝试设置程序化上传,用户(开发人员)可以在不使用网络表单的情况下上传文件,如果您想这样想的话,有点像API.

I have a web form that can be used to upload files to our server. I'm trying to also set up programmatic uploading where the user(developer) can upload the files without needing to use the web form, sort of like an API if you want to think of it this way.

我不确定此功能在用户端和我端的外观如何.我正在使用PHP.可以使用PHP对较大文件(10-100MB)完成这种程序化上传吗?

I'm not sure what this function is supposed to look like on either end: user end and my end. I'm using PHP. Can this sort of programmatic uploading be done with PHP for relatively large files (10-100MB)?

推荐答案

您可以创建一个将接受POST变量的API. POST变量可以包含文件.最终用户(或开发人员)可以使用cURL将数据发布到您的URL.

You can make an API that will accept POST variables. The POST variable can contain the file. The end user (or developer) can use cURL to post data to your URL.

没有最大的POST大小.这取决于您的服务器设置和PHP设置.

There is no maximum size for POST. It depends on your server settings and PHP settings.

这篇关于以编程方式上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆