Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
I am uploading images and text formatting data from front end using data bound forms. I want to download this data from the admin panel is it possible. If not, is there a work around for the same?

Regards,
GenXCoders
Image
where innovation meets technology
Hi,

Data uploaded using data-bound forms end up in editable regions that, of course, show up in the admin-panel.

So, I am sorry, I couldn't understand your problem - the data is already available in the admin-panel and can be downloaded.
@KK Sir,

Actually what I meant was, after a databound form is submitted, the data is available at the back end, the files attached can be downloaded and we can also control the size of the file from the editable region of type='securefile', using the max_size attribute. But I was curious if we use the font settings (as in front end editing) and then also pass the details like font face, font size, etc. to the backend in the admin panel.

I actually by mistake used the download terminology. :oops:

Regards,
GenXCoders
Image
where innovation meets technology
Also, I am trying to create repeatable region for images using the type='securefile'. But the result is that i get something like this:

Untitled.png
Untitled.png (12.81 KiB) Viewed 2879 times


What can be done for this?

My current code is:
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Test Form for Data Submission' clonable='1' >
   <cms:repeatable name='tbox' label='TBox' start_count='1'>
        <cms:editable name='inputbox' label='Text' type='text' />
    </cms:repeatable>
    <cms:repeatable name='ibox' label='IBox' startcount='1'>
        <cms:editable name='image' required='1' allowed_ext='jpg, jpeg, bmp, png' max_size='5120' type='securefile' />
    </cms:repeatable>
</cms:template>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Untitled Document</title>
        <link rel="stylesheet" href="css/simplegrid.css" type="text/css" />
        <style>
         input {
            border: 0px solid #dedede;
            background: #dedede;
            padding: 5px;
            border-radius: 5px;
         }
      </style>
        <script type="text/javascript" src="<cms:show k_admin_link/>includes/mootools-core-1.4.5.js"></script>
        <script type="text/javascript" src="<cms:show k_admin_link/>includes/mootools-more-1.4.0.1.js"></script>
        <script type="text/javascript" src="<cms:show k_admin_link/>addons/nicedit/nicEdit.js?kver=<cms:show k_cms_build />"></script>
        <script type="text/javascript" src="<cms:show k_admin_link/>addons/repeatable/tablegear/tablegear.js?kver=<cms:show k_cms_build />">             </script>
        <script type="text/javascript" src="<cms:show k_admin_link/>addons/repeatable/dg-arrange-table-rows/dg-arrange-table-rows.js?kver=<cms:show k_cms_build />"></script>
       
        <link rel="stylesheet" href="<cms:show k_admin_link/>addons/repeatable/tablegear/tablegear.css?kver=<cms:show k_cms_build />" type="text/css" media="screen" />
        <link rel="stylesheet" href="<cms:show k_admin_link/>addons/repeatable/dg-arrange-table-rows/dg-arrange-table-rows.css?kver=<cms:show k_cms_build />" type="text/css" media="screen" />
        <link rel="stylesheet" href="<cms:show k_admin_link/>addons/data-bound-form/datetime.css?kver=<cms:show k_cms_build />" type="text/css" media="screen" />
       
        <link rel="stylesheet" href="css/simplegrid.css" type="text/css" />
      <cms:load_edit />
   </head>

   <body>
   
       <cms:set submit_success="<cms:get_flash 'submit_success' />" />
        <cms:if submit_success >
            <h4>Success: Your application has been submitted.</h4>
        </cms:if>   
   
        <cms:form
            masterpage=k_template_name
            mode='create'
            enctype='multipart/form-data'
            method='post'
            anchor='0'
        >
            <cms:if k_success >
                <cms:db_persist_form _invalidate_cache='0' _auto_title='1' />
                <cms:set_flash name='submit_success' value='1' />
                <cms:redirect k_page_link />
            </cms:if>
            <cms:if k_error >
                <div class="error">
                    <cms:each k_error >
                        <br><cms:show item />
                    </cms:each>
                </div>
            </cms:if>
            <div class="grid grid-pad">
                <div class="col-1-1" style="border: 2px solid #f00;">
                    <div class="content">
                        <cms:input name='tbox' type='bound' /> 
                    </div>
                    <div style="height: 20px;"></div>
                </div>
               
                <div class="col-1-1" style="border: 2px solid #0f0;">
                   <div class="content">
                       <div <cms:inline_edit 'ibox' />><cms:input name='ibox' id='ibox' type='bound' /></div>
                    </div>
                </div>
               
                <div class="col-1-1">
                   <div class="content">
                       <cms:if "<cms:not submit_success />" >
                            <button type="submit">Submit Application</button>
                        </cms:if>
                    </div>
                </div>
               
            </div>
   
        </cms:form>
   
   </body>
</html>
<?php COUCH::invoke();?>
Image
where innovation meets technology
I am very sorry Aashish but securefile cannot be used in a repeatable manner (the system has to keep track of each individual securely uploaded file in the database - something that cannot be done where the number of files are variable as in repeatable-regions).

As for the first problem - again there is not much we can do with the appearance in the back-end.
@ KK Sir: Not a prob sir... Couch is still growing... And it will take time, but i really believe it will be the BEST CMS of this era!!!

I have a few queries:
1. Can we upload multiple images from front end in any other way, if not secure file!!!
2. Can we edit and save the fon settings from the front end???

Regards,
Aashish
Image
where innovation meets technology
Thank you Aashish :)

1. Can we upload multiple images from front end in any other way, if not secure file!!!
For non-admins, the only way to upload images from the front-end is 'securefile'.
To allow multiple uploads using securefile, you can try the following -

If there is a sane upper limit to the max number of images a visitor can upload with each submission (e.g. 10), we can define that number of securefile regions in the template.

On the frontend you can output all 10 in the form but use JS to make only one visible.
Give a 'more' button, for example, to unhide the other 9 regions.

Do you think this could help?
I am trying this as a solution. Will it be worth for the secure files region as you have suggested sir??

And As a matter of fact i have to only upload a few, lets assume 5 images only.

Will this (http://jsfiddle.net/VdW3P/1/) solve the problem!!!
Image
where innovation meets technology
I don't think the example code you mentioned would cut it, Aashish. That code is dynamically inserting input elements in the DOM.

What we'd like to do is (I think somewhat simpler) - all the 5 secure regions will always be present on the page. To begin with only one of them would be visible. Use JS to unhide the rest as needed.
9 posts Page 1 of 1
cron