dptdb84606 2015-12-15 18:42 采纳率: 0%
浏览 319
已采纳

如何释放内存或删除由http.ParseMultipartForm创建的临时文件?

I'm using http.ParseMultipartForm to handle file uploads at my webapp.
Documentation says:

ParseMultipartForm parses a request body as multipart/form-data. The whole request body is parsed and up to a total of maxMemory bytes of its file parts are stored in memory, with the remainder stored on disk in temporary files. ParseMultipartForm calls ParseForm if necessary. After one call to ParseMultipartForm, subsequent calls have no effect.

When the memory and/or temporary file will be deleted?

  • 写回答

1条回答 默认 最新

  • dongyun234854 2015-12-15 18:53
    关注

    Everything is freed after the request is complete.

    The memory buffers will be available for garbage collection, and any temporary files will be removed by the call to MultipartForm.RemoveAll() at the end of the request.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 51单片机使lcd显示器开机闪烁预设字符闪烁3次需要加什么代码
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥15 想用@vueuse 把项目动态改成深色主题,localStorge里面的vueuse-color-scheme一开始就给我改成了dark,不知道什么原因(相关搜索:背景颜色)
  • ¥20 OPENVPN连接问题
  • ¥15 flask实现搜索框访问数据库
  • ¥15 mrk3399刷完安卓11后投屏调试只能显示一个设备
  • ¥100 如何用js写一个游戏云存档
  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题