dragon2025 2012-05-06 00:48
浏览 85
已采纳

php将文件保存到特定位置

I am a bit of a dummy when it comes to php. I was wondering how to save a file uploaded to a php script (using POST) to a specific location. So for example i want to save it in the directory www.mysite.co.nz/data/motelname/

Also the android sends pairs of data, so how would i make that data into a file with the first bit of data the file name and the second the .txt file data.

If there are any tutorials on this please comment the here too thanks.

  • 写回答

1条回答 默认 最新

  • douxin9135 2012-05-06 00:59
    关注

    check out these:

    http://www.htmlgoodies.com/beyond/php/article.php/3472551/PHP-Tutorial-Uploading-Files.htm

    http://www.sitepoint.com/handle-file-uploads-php/

    you can move the uploaded file to every folder that has 777-rights (do it with "chmod 777 foldername" on the shell) via

    move_uploaded_file($tmp_name, "my_directory/$filename");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line