简体   繁体   English

使用 xampp 访问 apache 服务器上的数据

[英]access data on apache server using xampp

i am writing an iphone application, which basically uploads and downloads Images to/from a server.我正在编写一个 iphone 应用程序,它基本上将图像上传到服务器或从服务器下载图像。 in order to test my code i installed xampp and everything works fine now.为了测试我的代码,我安装了 xampp,现在一切正常。 if i upload an image the server creates a folder named with the UDID-number of the device (via the http-method POST a php script is called).如果我上传图像,服务器会创建一个以设备的 UDID 编号命名的文件夹(通过 http 方法 POST 调用 php 脚本)。

but if i enter the directory of such a folder and the name of the image in the browser i can see it in the browser.但是如果我在浏览器中输入这样一个文件夹的目录和图像的名称,我可以在浏览器中看到它。 i am a newby on this topic and have no idea if there are better possibilities.我是这个话题的新手,不知道是否有更好的可能性。 my questions are: should i use databases where i save the images or is it just fine to create folders via a php script and save the images into these folders?我的问题是:我应该使用保存图像的数据库,还是可以通过 php 脚本创建文件夹并将图像保存到这些文件夹中? can i hide all the datastructure, such that you cannot access it via a browser but only with the iphone application?我可以隐藏所有数据结构,这样您就无法通过浏览器访问它,而只能通过 iphone 应用程序访问它吗? (the application should only be able to download pictures randomly). (应用程序应该只能随机下载图片)。 thx谢谢

If you do not want an image serverable by apache, you need to store it outside the webroot.如果您不想要 apache 可服务器的图像,则需要将其存储在 webroot 之外。 So if your webroot is C:\xampp\htdocs, you could store the images in a folder structure under C:\xampp\images因此,如果您的 webroot 是 C:\xampp\htdocs,您可以将图像存储在 C:\xampp\images 下的文件夹结构中

Your iphone app would have to do a little more work then to pull a random one and send it to the user.您的 iphone 应用程序将不得不做更多的工作,然后随机抽取一个并将其发送给用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM