V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fangwenxue
V2EX  ›  问与答

cf worker 上传文件损坏?

  •  
  •   fangwenxue · Mar 3, 2021 · 923 views
    This topic created in 1890 days ago, the information mentioned may be changed or developed.
    curl xxx -F "[email protected]"
    
    const formData = await request.formData()
    const body = formData.get('file')
    console.log(body)
    
    // const reader = request.body.getReader()
    // const body = request.body
    
    const token = await getAccessToken()
    const response = await fetch(url, {
    method: 'PUT',
    headers: {
    Authorization: `Bearer ${token}`,
    ...request.headers
    },
    body: body
    })
    
    • 对比了源文件跟上传的文件
    • 这是乱码了?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3766 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 04:50 · PVG 12:50 · LAX 21:50 · JFK 00:50
    ♥ Do have faith in what you're doing.