Generating multipart boundary

后端 未结 4 1565
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 13:00

I\'m writing a script that uploads a file to a cgi script that expects a multipart request, such as a form on a HTML page. The boundary is a unique token that a

4条回答
  •  轮回少年
    2020-12-13 13:46

    If you are feeling paranoid, you can generate a random boundary and search for it in the string to be sent, append random char (or re-create new) on find, repeat. But my experience is any arbitrary non-dictionary string of 10 or so characters is about impossible to occur, so picking something like ---BOUNDARY---BOUNDARY---BOUNDARY--- is perfectly sufficient.

提交回复
热议问题