Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full downloadable example #6

Closed
pinkopalla opened this issue Aug 23, 2012 · 20 comments
Closed

Full downloadable example #6

pinkopalla opened this issue Aug 23, 2012 · 20 comments

Comments

@pinkopalla
Copy link

Something seems not to work here. Do someone would to share a full example?

@boutell
Copy link
Member

boutell commented Aug 23, 2012

How about some specifics of what went wrong?

A sandbox project would be nice, yes.

On Thu, Aug 23, 2012 at 8:37 AM, pinkopalla notifications@github.comwrote:

Something seems not to work here. Do someone would to share a full example?


Reply to this email directly or view it on GitHubhttps://github.com//issues/6.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

@pinkopalla
Copy link
Author

Yes, you are right!

In the twig template, line 39, I guess there is a minor issue concerning with class (a mislplaced "="). See:

The tutorial has some errors (maybe only typos, but the bundle doesn't work for me, so I can't say). See for instance the form definition:

A closing ")" is missing when building the path.

I think that a downloadable controller and the related twig would be appreciated!
Thanks.
When I apply the tutorial

@boutell
Copy link
Member

boutell commented Aug 23, 2012

This message is all chopped up, I think it's missing a bunch of what you said...?

@pinkopalla
Copy link
Author

Right! Sorry!
See in the "In the Edit Template" section of the tutorial
class="edit-form" action="{{ path('edit', { id: posting.id, editId: editId }}"

@boutell
Copy link
Member

boutell commented Sep 20, 2012

You're correct, I was missing some punctuation in that example. In my actual project I pass in the action URL, I wrote the path off the top of my head when turning my code into sample code and wasn't careful enough with the syntax. I fixed this in the README.

@boutell boutell closed this as completed Sep 20, 2012
@alexandre-melard
Copy link

Hi boutell, first thanks you for your work, I was willing to use the BlueImp app in Symfony2 and you did the job already 👍
Now, I am new to symfony (a week) and I lack some knowledge to understand your documentation... A sandbox would be realy helpfull, if you could provide me with a sample of controler + form (in PM if you like) that would be realy apreciated.

@boutell
Copy link
Member

boutell commented Nov 6, 2012

There's pretty much a full example in the documentation, have you been
through it?

On Tue, Nov 6, 2012 at 5:49 AM, amelard notifications@github.com wrote:

Hi boutell, first thanks you for your work, I was willing to use the
BlueImp app in Symfony2 and you did the job already [image: 👍]
Now, I am new to symfony (a week) and I lack some knowledge to understand
your documentation... A sandbox would be realy helpfull, if you could
provide me with a sample of controler + form (in PM if you like) that would
be realy apreciated.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10106203.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

@alexandre-melard
Copy link

Hi, thank's for the quick response. I have been through it, but as I said, I'm newbie in symfony2...
So when I copy/pasted :

$request = $this->getRequest();

$editId = $this->getRequest()->get('editId');
if (!preg_match('/^\d+$/', $editId))
{
    $editId = sprintf('%09d', mt_rand(0, 1999999999));
    if ($posting->getId())
    {
        $this->get('punk_ave.file_uploader')->syncFiles(
            array('from_folder' => 'attachments/' . $posting->getId(), 
              'to_folder' => 'tmp/attachments/' . $editId,
              'create_to_folder' => true));
    }
}

and I get "$posting undefined " I get stuck... I'm reading loads of documentation at the moment in order to understand but a working example would help me greatly.

@boutell
Copy link
Member

boutell commented Nov 6, 2012

$posting is your object, the thing you want to associate the file with.
It's up to you to supply application logic and a reason why the files are
being uploaded in some context or other.

On Tue, Nov 6, 2012 at 8:46 AM, alexandre melard
notifications@github.comwrote:

Hi, thank's for the quick response. I have been through it, but as I said,
I'm newbie in symfony2...
So when I copy/pasted :

$request = $this->getRequest();
$editId = $this->getRequest()->get('editId');if (!preg_match('/^\d+$/', $editId)){
$editId = sprintf('%09d', mt_rand(0, 1999999999));
if ($posting->getId())
{
$this->get('punk_ave.file_uploader')->syncFiles(
array('from_folder' => 'attachments/' . $posting->getId(),
'to_folder' => 'tmp/attachments/' . $editId,
'create_to_folder' => true));
}}

and I get "$posting undefined " I get stuck... I'm reading loads of
documentation at the moment in order to understand but a working example
would help me greatly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10110931.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

@alexandre-melard
Copy link

Ok, I think I understand better, when files are uploaded using the form,
they go in the "from_folder" identified by:
" 'attachments/' . $posting->getId()"
You then copy/synch them to the "to_folder" identified by:
" 'tmp/attachments/' . $editId"
Then you do some validation on the files before moving them to another
folder or database.

$posting->getId() represents the name of the folder in relation with the
current processus. Thing is you discourage the use of this Id and advise
the use of a randomized Id instead.

Am I right?

On 6 November 2012 15:03, Tom Boutell notifications@github.com wrote:

$posting is your object, the thing you want to associate the file with.
It's up to you to supply application logic and a reason why the files are
being uploaded in some context or other.

On Tue, Nov 6, 2012 at 8:46 AM, alexandre melard
notifications@github.comwrote:

Hi, thank's for the quick response. I have been through it, but as I
said,
I'm newbie in symfony2...
So when I copy/pasted :

$request = $this->getRequest();
$editId = $this->getRequest()->get('editId');if (!preg_match('/^\d+$/',
$editId)){
$editId = sprintf('%09d', mt_rand(0, 1999999999));
if ($posting->getId())
{
$this->get('punk_ave.file_uploader')->syncFiles(
array('from_folder' => 'attachments/' . $posting->getId(),
'to_folder' => 'tmp/attachments/' . $editId,
'create_to_folder' => true));
}}

and I get "$posting undefined " I get stuck... I'm reading loads of
documentation at the moment in order to understand but a working example
would help me greatly.


Reply to this email directly or view it on GitHub<
https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10110931>.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10111405.

@boutell
Copy link
Member

boutell commented Nov 6, 2012

I encourage the use of a randomized ID during the editing, and syncing to
something based on the permanent ID on save, yes. I do that because it
allows you to click "cancel" and leave the page and not have the unpleasant
surprise that your changes to attached files did not "cancel" like
everything else in the form. This is what I'm getting at when I talk about
the "editId pattern" in the documentation.

On Tue, Nov 6, 2012 at 9:18 AM, alexandre melard
notifications@github.comwrote:

Ok, I think I understand better, when files are uploaded using the form,
they go in the "from_folder" identified by:
" 'attachments/' . $posting->getId()"
You then copy/synch them to the "to_folder" identified by:
" 'tmp/attachments/' . $editId"
Then you do some validation on the files before moving them to another
folder or database.

$posting->getId() represents the name of the folder in relation with the
current processus. Thing is you discourage the use of this Id and advise
the use of a randomized Id instead.

Am I right?

On 6 November 2012 15:03, Tom Boutell notifications@github.com wrote:

$posting is your object, the thing you want to associate the file
with.
It's up to you to supply application logic and a reason why the files
are
being uploaded in some context or other.

On Tue, Nov 6, 2012 at 8:46 AM, alexandre melard
notifications@github.comwrote:

Hi, thank's for the quick response. I have been through it, but as I
said,
I'm newbie in symfony2...
So when I copy/pasted :

$request = $this->getRequest();
$editId = $this->getRequest()->get('editId');if
(!preg_match('/^\d+$/',
$editId)){
$editId = sprintf('%09d', mt_rand(0, 1999999999));
if ($posting->getId())
{
$this->get('punk_ave.file_uploader')->syncFiles(
array('from_folder' => 'attachments/' . $posting->getId(),
'to_folder' => 'tmp/attachments/' . $editId,
'create_to_folder' => true));
}}

and I get "$posting undefined " I get stuck... I'm reading loads of
documentation at the moment in order to understand but a working
example
would help me greatly.


Reply to this email directly or view it on GitHub<

https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10110931>.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com


Reply to this email directly or view it on GitHub<
https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10111405>.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10111971.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

@alexandre-melard
Copy link

Thanks for your help, I understand better now :) I'm going to move on and
I'll let you know if I manage to obtain something working !

On 6 November 2012 15:55, Tom Boutell notifications@github.com wrote:

I encourage the use of a randomized ID during the editing, and syncing to
something based on the permanent ID on save, yes. I do that because it
allows you to click "cancel" and leave the page and not have the
unpleasant
surprise that your changes to attached files did not "cancel" like
everything else in the form. This is what I'm getting at when I talk about
the "editId pattern" in the documentation.

On Tue, Nov 6, 2012 at 9:18 AM, alexandre melard
notifications@github.comwrote:

Ok, I think I understand better, when files are uploaded using the form,
they go in the "from_folder" identified by:
" 'attachments/' . $posting->getId()"
You then copy/synch them to the "to_folder" identified by:
" 'tmp/attachments/' . $editId"
Then you do some validation on the files before moving them to another
folder or database.

$posting->getId() represents the name of the folder in relation with the
current processus. Thing is you discourage the use of this Id and advise
the use of a randomized Id instead.

Am I right?

On 6 November 2012 15:03, Tom Boutell notifications@github.com wrote:

$posting is your object, the thing you want to associate the file
with.
It's up to you to supply application logic and a reason why the files
are
being uploaded in some context or other.

On Tue, Nov 6, 2012 at 8:46 AM, alexandre melard
notifications@github.comwrote:

Hi, thank's for the quick response. I have been through it, but as I
said,
I'm newbie in symfony2...
So when I copy/pasted :

$request = $this->getRequest();
$editId = $this->getRequest()->get('editId');if
(!preg_match('/^\d+$/',
$editId)){
$editId = sprintf('%09d', mt_rand(0, 1999999999));
if ($posting->getId())
{
$this->get('punk_ave.file_uploader')->syncFiles(
array('from_folder' => 'attachments/' . $posting->getId(),
'to_folder' => 'tmp/attachments/' . $editId,
'create_to_folder' => true));
}}

and I get "$posting undefined " I get stuck... I'm reading loads of
documentation at the moment in order to understand but a working
example
would help me greatly.


Reply to this email directly or view it on GitHub<

https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10110931>.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com


Reply to this email directly or view it on GitHub<

https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10111405>.


Reply to this email directly or view it on GitHub<
https://github.com/punkave/symfony2-file-uploader-bundle/issues/6#issuecomment-10111971>.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10113257.

@alexandre-melard
Copy link

Hi Boutell,

I finally got through and have your bundle up and running... I had quite an hard time but the result is worth it!!
I was wondering if I could write some code for you as I think the filemanager needs a little refactoring (i'm thinking about using the filesystem extension to get rid of the systems call...

Beside I think a little sandbox would do no harm, I am going to fork your bundle anyway and let you know where I endup...

Cheers!

@boutell
Copy link
Member

boutell commented Nov 13, 2012

Fork away and have fun! I am reluctant to eliminate the system calls
entirely because rsync is a very, very efficient way to do what I'm doing,
especially if you're editing an existing collection of files. Perhaps they
could be optional. That would be nice for any suffering souls without
access to rsync.

On Tue, Nov 13, 2012 at 4:52 PM, alexandre melard
notifications@github.comwrote:

Hi Boutell,

I finally got through and have your bundle up and running... I had quite
an hard time but the result is worth it!!
I was wondering if I could write some code for you as I think the
filemanager needs a little refactoring (i'm thinking about using the
filesystem extension to get rid of the systems call...

Beside I think a little sandbox would do no harm, I am going to fork your
bundle anyway and let you know where I endup...

Cheers!


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10345457.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

@alexandre-melard
Copy link

Let see where we get, I'm also a big fan of rsync 👍

@Kwadz
Copy link

Kwadz commented Jan 3, 2013

Is this the full example for symfony2-file-uploader-bundle ?
https://github.com/mylen/jquery-file-upload-sandbox

@alexandre-melard
Copy link

@Kwadz This is an example of my fork of the jquery file uploader, which has gone quite fare from tom's branch.
You are welcome to give me any feedback if you wish if there is any problem let me know.

@nelson777
Copy link

Hi boutell/mylen,

I also can't get it to work. Kinda lost here. First: do I have to install BlueImp also ? or is everything needed in this bundle ? I tryied to implement mylen example, without any success also.
It renders only a basic select file (no css) and renders also the upload bar when I select a file for upload, but I see no progress while it's being uploaded nor I can find anywhere the files uploaded. Take a look
punkaveu
:
But let's start from the start: for me to see this:
http://blueimp.github.io/jQuery-File-Upload/
what do I have to do ? I just want to see the main interface first. Then I check the file ids, randomize them etc.
I'm really lost. An working example would help a lot.

@alexandre-melard
Copy link

Hi!

Thanks you for your interest. I'll try to find some time today to fix the
sandbox

Alex
Le 17 sept. 2013 23:12, "nelson777" notifications@github.com a écrit :

Hi boutell/mylen,

I also can't get it to work. Kinda lost here. First: do I have to install
BlueImp also ? or is everything needed in this bundle ? I tryied to
implement mylen example, without any success also.
It renders only a basic select file (no css) and renders also the upload
bar when I select a file for upload, but I see no progress while it's being
uploaded nor I can find anywhere the files uploaded. Take a look:
http://picpaste.com/punkaveu-gFo0jVjK.png
But let's start from the start: for me to see this:
http://blueimp.github.io/jQuery-File-Upload/
what do I have to do ? I just want to see the main interface first. Then I
check the file ids, randomize them etc.
I'm really lost. An working example would help a lot.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-24622817
.

@pnnartas
Copy link

Hi my controller function;

public function imageAction( Request $request){
    $editId = $this->getRequest()->get('editId');
    if (!preg_match('/^\d+$/', $editId))
    {
        $editId = sprintf('%09d', mt_rand(0, 1999999999));
        if ($posting->getId())
        {
            $this->get('punk_ave.file_uploader')->syncFiles(
                array('from_folder' => 'attachments/' . $posting->getId(), 
                  'to_folder' => 'tmp/attachments/' . $editId,
                  'create_to_folder' => true));
        }
   }    
   return $this->render('PikoCRMEcommerceBundle:Product:product_addd.html.twig',array(
       'editId'=>$editId,
   ));
}

but :(

code run

Variable "posting" does not exist in PikoCRMEcommerceBundle:Product:product_add.html.twig at line 102

Where is the error have to identify how the $posting

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

No branches or pull requests

6 participants