Success

User tests: Successful: Unsuccessful:

avatar b2z
b2z
4 Dec 2013

This will implement images upload feature.

avatar b2z b2z - open - 4 Dec 2013
avatar b2z
b2z - comment - 4 Dec 2013

Current issues (@elkuku I will need your help here):

  • why html tags are not transformed?

untitled

  • how to make en-GB translation file? I want to place there these long translations.
avatar b2z
b2z - comment - 16 Dec 2013

@elkuku can you help here with the language problem? :) Thanks!

avatar elkuku
elkuku - comment - 16 Dec 2013

I will.. try ;)

avatar elkuku
elkuku - comment - 16 Dec 2013

What do I have to do to make those messages appear ? Where are they defined ??

avatar b2z
b2z - comment - 17 Dec 2013

Here are the lines in the template file and here is translation.

And one more - do we stick to CAPS for long translations or?

avatar elkuku
elkuku - comment - 17 Dec 2013

Turns out I had not updated my branch, now I found the code....

You have to pass the strings to Twigs "raw" filter, or the text will be escaped by default

<li>{{ "Max file size note"|_|raw }}</li>

Yes I would prefer all caps keys like

<li>{{ "MAX_FILE_SIZE_NOTE"|_|raw }}</li>

On the other hand, the texts are not that long, so you might just write them in the code without using a key (including HTML entities..). This way you also won't need the en-GB language file ;)

Maybe:

<li>{{ "The maximum file size for uploading - <strong> 1 MB </strong>."|_|raw }}</li>

But even more important... shouldn't that be a sprintf() and the value coming from some config ?

avatar b2z
b2z - comment - 17 Dec 2013

Ah thanks! Missed that |raw filter.

This way you also won't need the en-GB language file

But I would use CAPS then I should create that manually, right?

shouldn't that be a sprintf() and the value coming from some config ?

Yes I was thinking about it, but then we need to make the config values human readable.

avatar elkuku
elkuku - comment - 17 Dec 2013

I should create that manually, right?

I think yes... Otherwise we would have to generate english language files for all the Apps.

we need to make the config values human readable.

I think we might just dump them in as they are defined in config... our users are expected to be smart enough to figure out what they mean :tongue:

avatar b2z
b2z - comment - 23 Dec 2013

I think we might just dump them in as they are defined in config... our users are expected to be smart enough to figure out what they mean

Do you think this will look good?

Only images are allowed (image/png, image/jpeg, image/gif)

And MB will be simply M...

avatar elkuku
elkuku - comment - 23 Dec 2013

Do you think this will look good?

You could write a function to replace those image/* things and to convert M to MB but, honestly, I wouldn't bother with those details.

Would be nice to have all those elements hidden in some div... In the end we could live with just the drag & drop thingy.

Are there other issues beside the language? Can we merge this ? (needs update) :wink:

avatar b2z
b2z - comment - 23 Dec 2013

Yeah it needs update, but I'm waiting the master branch to fix first (see #275), then update this one and retest :)

avatar b2z
b2z - comment - 30 Dec 2013

One more tricky thing - do we want all our uploads to be in the same uploads dir? Or these will be in dirs like /uploads/projectID/issueNumber or /uploads/projectID ?

avatar elkuku
elkuku - comment - 30 Dec 2013

Another "tricky" question: Is there any "clean up job" defined ? -- I mean: search and delete unused media ?
I think it wouldn't be bad to add some "structure", which might also help in "cleanup jobs" like /uploads/projectAlias/issueNumber

Otherwise, what would be the use case for those (sub)directories ?

avatar b2z
b2z - comment - 30 Dec 2013

You are right some clean up job should be defined. And we will definately need a proper structure for it to identify unused media. For me /uploads/projectID/issueNumber is a good option, cause projectAlias can be changed.

avatar elkuku
elkuku - comment - 30 Dec 2013

issueNumber is a good option, cause projectAlias can be changed.

good point ;)

avatar b2z
b2z - comment - 31 Dec 2013

Well /uploads/projectID/issueNumber will not work :( When we add a new issue we do not know the exact issue number... So we can stick with the /uploads/projectID only. What do you think, do we need the issueNumber for the clean up job? What will be the scenario for this clean up job? In theory an issue should not be deleted, but a project probably can be. So clean up could delete all the media under the specific projectID dir? :confused:

avatar b2z
b2z - comment - 10 Jan 2014

Guys I need your answers here. We need to go forward - more issues are waiting :)

avatar betweenbrain
betweenbrain - comment - 10 Jan 2014

I would say that old issues shouldn't be deleted, so maybe the clean up job is project based.

One idea, and I'm not claiming that it is a good one :wink:, is to upload the file to /uploads/projectID/tmp[Random] and then move it to /uploads/projectID/issueNumber after the issue is saved. [Random] would be a random string generated when you begin creating a new issue.

avatar b2z
b2z - comment - 16 Jan 2014

Long story :laughing: So I suppose that /uploads/projectID/ would be enough?

avatar elkuku
elkuku - comment - 16 Jan 2014

Let's say :+1: and see how it goes :wink:

avatar b2z
b2z - comment - 18 Jan 2014

Ok, now the files are uploaded to the /uploads/projectID/. Note the code does not create upload directories on the fly because it will lead to more complex implementation. Are we ok with creating them manually? Basically you should create something like /uploads/1 and /uploads/2 under www directory.

avatar b2z
b2z - comment - 20 Jan 2014

Cmon guys I know we can do it! Let's finish these waiting PRs and move forward implementing new features and fixing issues :muscle:

avatar elkuku
elkuku - comment - 20 Jan 2014

So after deploying the code to the server, the upload directories have to be created manually ?

avatar b2z
b2z - comment - 20 Jan 2014

So after deploying the code to the server, the upload directories have to be created manually ?

Yeap. The implementation of the auto-creation seems to me now not so complicated and complex, but do we need it? If we would have /uploads/projectID/issueNumber storage then it would make sense.

avatar elkuku
elkuku - comment - 22 Jan 2014

Erm.. could you update this again? From what I can see only language files and the composer file have been changed ;)

avatar b2z
b2z - comment - 22 Jan 2014

From what I can see only language files and the composer file have been changed ;)

How it can be? ^_^ Here the latest commit b0b4758

avatar elkuku
elkuku - comment - 22 Jan 2014

I mean they are conflicting.. sorry.

avatar elkuku elkuku - reference | - 22 Jan 14
avatar elkuku elkuku - merge - 22 Jan 2014
avatar elkuku elkuku - close - 22 Jan 2014
avatar elkuku
elkuku - comment - 22 Jan 2014

We have image upload functionality - Thanks @b2z :wink:

avatar elkuku elkuku - head_ref_deleted - 22 Jan 2014
avatar b2z
b2z - comment - 22 Jan 2014

@mbabker you will need to pull upload scripts with the bower install, otherwise uploads will not work ^_^. And there are changes in the config.json also: uploads directory and validations, so you should create something like /uploads/1 and /uploads/2 under www directory :)

I hope everything will be fine cause I am going to sleep now and will not help :sleeping:

avatar b2z
b2z - comment - 22 Jan 2014

@elkuku also looking on the translations progress (transifex is here) I see that you was right - we should sprintf validation conditions from the config. Otherwise it will be difficult to change these values, because they will be hardcoded into so many languages...

avatar mbabker
mbabker - comment - 22 Jan 2014

Updated the server, created the /uploads directory and child directories. Hopefully it isn't broken :-D

avatar b2z
b2z - comment - 23 Jan 2014

Oops, forgot to mention that you need to update deps also :) Trying to upload and get Error 500 -> Class 'Upload\File' not found :tongue:

avatar mbabker
mbabker - comment - 24 Jan 2014

I was working with Rochen on a memory issue with that actually, all's well now and the composer dependencies are now up-to-date.

avatar elkuku
elkuku - comment - 24 Jan 2014

That's good news - Thanks Rochen ;)
What about Bower - how do you manage to sync those media files ? ...

avatar mbabker
mbabker - comment - 24 Jan 2014

I'm doing that by FTP.

avatar elkuku
elkuku - comment - 24 Jan 2014

Well that's... not so good, but I think some more time has to pass until hosting providers are going to offer such advanced tools to their clients ;)

avatar b2z
b2z - comment - 24 Jan 2014

Still can not upload - Directory does not exist... Have you enabled config options: uploads and validations ?

avatar mbabker
mbabker - comment - 25 Jan 2014

I changed the config to the absolute path and now I'm getting a Empty file upload result error. This might be why though; running composer install on the server gets me: - codeguy/upload dev-master requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.

avatar b2z
b2z - comment - 25 Jan 2014

That's bad :( Is there a chance to enable this extension?

avatar elkuku
elkuku - comment - 25 Jan 2014

It has been explicitly disabled.. see phpinfo:
./configure' '--disable-fileinfo'

avatar b2z
b2z - comment - 27 Jan 2014

:worried: that sounds very bad

avatar b2z
b2z - comment - 7 Feb 2014

@mbabker any news on it?

avatar mbabker
mbabker - comment - 7 Feb 2014

Working on getting it enabled.

On Friday, February 7, 2014, Dmitry Rekun notifications@github.com wrote:

@mbabker https://github.com/mbabker any news on it?

Reply to this email directly or view it on GitHub#251 (comment)
.

avatar mbabker
mbabker - comment - 26 Feb 2014

Just tried to upload a couple items to this issue on the site (finally got fileinfo enabled) and got Empty file upload result messages on both images (one PNG and one JPG image).
You may blame the J!Tracker Application for transmitting this comment.

avatar b2z
b2z - comment - 27 Feb 2014

That's a generic message. The real error message is in XHR and currently it is:
"error":"Directory does not exist"

avatar mbabker
mbabker - comment - 28 Feb 2014

OK, figured it out. I had the uploads folder in the wrong place in the filesystem. It's good to go.
You may blame the J!Tracker Application for transmitting this comment.

avatar b2z
b2z - comment - 28 Feb 2014

ok, testing uploads :)

screen shot 2014-02-28 at 02 57 24
You may blame the J!Tracker Application for transmitting this comment.

Add a Comment

Login with GitHub to post a comment