Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

AJAX上传文件后,文件怎样与业务数据关联... #250

Closed
hidmouth opened this issue Jun 20, 2014 · 1 comment
Closed

AJAX上传文件后,文件怎样与业务数据关联... #250

hidmouth opened this issue Jun 20, 2014 · 1 comment

Comments

@hidmouth
Copy link

表单中除了需要填写业务数据,还需要上传一张封面图片。表单对应业务记录的 ID 是存入数据库时生成的。我现在是这样做的,AJAX上传封面图片,返回一个文件ID,然后将其赋给表单中一个 hidden input,提交表单后,将业务数据和封面图片ID保存。
感觉没必要多搞一个 hidden input 出来。。。有没有更好的法子?

@2betop
Copy link
Contributor

2betop commented Jun 20, 2014

你是想在文件上传封面的时候顺带把你表单里面的其他字段都带过去?
如果是,看看这个你就知道怎么做了。 #145

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants