webform image upload - Where is kept in database?
HI guys, I am working with webform and so far so good but I am having the problem that when I createa form using webform and the form has a image upload I can not find the image url in the table. I know where the images are on the server but nothing tells me which image goes with which submission. If I edit the submission it shows the image path or URL but in the table where do I find this. I do not see it in webform or webform_submissions o webform_submitted_data tables. Where is the image url kept on the table? thanks!!!
when I do a select on teh webform_submitted_data table select * from webform_submitted_data where nid=9515 and sid=1421; the record where the image give me the number 673 nid sid cid no data 9515 1421 6 0 673 How does that finds the path of the uploaded file? HELP? On Tue, Oct 28, 2014 at 10:51 AM, Néstor <rotsen@gmail.com> wrote:
HI guys,
I am working with webform and so far so good but I am having the problem that when I createa form using webform and the form has a image upload I can not find the image url in the table.
I know where the images are on the server but nothing tells me which image goes with which submission.
If I edit the submission it shows the image path or URL but in the table where do I find this. I do not see it in webform or webform_submissions o webform_submitted_data tables.
Where is the image url kept on the table?
thanks!!!
I found my answer but I used PHP coding and there is probably a better way using webform functions. 1) I create a page of type page 2) I added the below code to obtain and display my webform information ------------------------ <?php // set the table titles $header = array('FIRST', 'LAST', 'COMMENT', 'ZIP', 'PHOTO'); // get data from webform_views_nestorwebform table // this table is created by the webform_mysql_views module // and it contains the data from a webform $query = "SELECT first, last, comment, zip, photo FROM {webform_views_nestorwebform} where approved=1 ORDER BY first"; $q = db_query($query); // move the returned array to $rows while ($r = db_fetch_array($q)) { $rows[] = $r; } for($i=0; $i<count($rows);$i++) { foreach($rows[$i] as $key => $value) { if($key == 'photo' && $value > 0) { $fid=$value; $myfile = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $fid)); $fname=$myfile->filename; $fpath=$myfile->filepath; $rows[$i][$key] = "<a href='$fpath'><img src='$fpath' width='50px' height='30px'></a><Br\n"; } } } // the theme function automatically create the table title // and display the data for the table print theme('table', $header, $rows); ?> ---------------------------------------- If you know a better way, please let me know, Thanks!!! On Tue, Oct 28, 2014 at 12:29 PM, Néstor <rotsen@gmail.com> wrote:
when I do a select on teh webform_submitted_data table select * from webform_submitted_data where nid=9515 and sid=1421;
the record where the image give me the number 673
nid sid cid no data 9515 1421 6 0 673
How does that finds the path of the uploaded file?
HELP?
On Tue, Oct 28, 2014 at 10:51 AM, Néstor <rotsen@gmail.com> wrote:
HI guys,
I am working with webform and so far so good but I am having the problem that when I createa form using webform and the form has a image upload I can not find the image url in the table.
I know where the images are on the server but nothing tells me which image goes with which submission.
If I edit the submission it shows the image path or URL but in the table where do I find this. I do not see it in webform or webform_submissions o webform_submitted_data tables.
Where is the image url kept on the table?
thanks!!!
participants (1)
-
Néstor