Php脚本将文件从客户端的计算机上传到服务器 [英] Php script to upload file from client's computer to server

查看:148
本文介绍了Php脚本将文件从客户端的计算机上传到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以在我告诉你我的具体问题之前,我想要创建的是一个C#应用程序,它将管理用户的吉他踏板的共享预设。所以为了做到这一点,我需要能够从用户的计算机上传文件到我的服务器/主机。



我可以使用内置的C#库来建立ftp连接并将文件上传到我的服务器,但随后我的宝贵信息将被暴露并且容易被人看到而不管我试图加密/混淆代码。



所以为了保护我的信息,我想创建一个php脚本来进行上传,但是我需要从我的C#应用​​程序中调用php脚本。我可以轻松地将C#中的webrequests发送到php页面,我现在正在做的是从我的数据库中提供数据,但是将文件上传到我的服务器是完全不同的。



任何人都知道我怎么做这个?

So before I tell you my specific issue, what I am trying to create is a C# application that will manage user's shared presets for a guitar pedal. So in order to do this, I need the ability to upload files from the user's computer, to my server/hosting.

I could use built in C# libraries to make an ftp connection and upload files to my server, but then my precious information would be exposed and vulnerable to being seen regardless of my attempts to encrypt/obfuscate the code.

So in order to protect my information I want to create a php script to do the uploading, but I need to invoke the php script from my C# application. I can easily make webrequests in C# to php pages, which I am doing now to serve the data from my database, but uploading files to my server is quite different.

Anyone know how I might do this?

推荐答案

你错过了什么。为了善良,加密/混淆是什么?如果有人发布文件,则可能会被窃听,但您可以使用HTTPS让用户发送加密的数据。我不确定这是不是你的问题。除了我上面解释的考虑因素外,根本没有可能危及您安全的选项。在所有情况下,您都使用Web表单或Ajax发布文件。在所有情况下,您必须使用一些PHP(或任何其他服务器端技术)来接受发布数据,包括您的文件。这是在服务器端发生的事情,不会暴露在互联网上。



-SA
You are missing something. What encryption/obfuscation, for goodness sake? If someone posts a file, it can be eavesdropped, but you can use HTTPS to let the user send the data encrypted. I'm not sure if this is your concern. Except for the consideration I explained above, there are simply no options which can compromise your security. In all cases, you use a Web form or Ajax to post the file. In all cases, you have to use some PHP (or any other server-side technology) to accept the post data, including your file. And that is something which happens on the server side and is not exposed to the Internet.

—SA

这篇关于Php脚本将文件从客户端的计算机上传到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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