如何通过javascript在dropzone上传文章中发送csrf令牌?

时间:2017-10-06 07:14:59

标签: javascript php html codeigniter

我正在开发codeigniter项目,当我在配置文件中启用CSRF保护并在所有表单网站中添加csrf令牌隐藏字段时工作正常但由于这个原因我面临一个问题,即"您要求的操作是不允许"使用dropzone上传图片时。

如何在dropzone js中传递csrf令牌?

当我在dropzone框中上传图片时,它会出错:

  

不允许您请求的操作。

results = db.session.execute(stmt).fetchall()

1 个答案:

答案 0 :(得分:2)

import numpy as np
import cv2
from matplotlib import pyplot as plt

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    # Display the resulting frame
    cv2.imshow('frame',gray)


    # Initiate feature detector
    orb = cv2.FastFeatureDetector_create()

    # find the keypoints with ORB
    kp = orb.detect(gray)

    img2 = cv2.drawKeypoints(frame, kp, outImage=None, color=(0, 255, 0), flags=0)
    plt.imshow(img2), plt.show()

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break


# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()