douling8087 2019-07-01 13:58
浏览 193

将PDF文件的内容发送到外部API?

Using Gravity Forms, I have a php form with a PDF file upload field. We pass the form data (json) to a third party API. However, it is sending the PDF as a url to the file, and we need to actually pass the contents of the PDF encoded in the body.

We can use the following filter to modify the request data before the webhook is set, but I don't know how to encode the actual file contents:

add_filter( 'gform_webhooks_request_data', 'modify_data', 10, 4 );
function modify_data( $request_data, $feed, $entry, $form ){
  $request_data = // do something
  return $request_data;
}

How is it possible to read the file contents of the PDF and base64 encode it?

Thank you!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏