2 of 2
2
Hardcoded SAEF File Upload in EE2
Posted: 05 July 2010 01:05 AM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  446
Joined  01-14-2006

ok, I’ve updated the Extension, my bad. I was testing mostly on a stand alone edit form, and uploading 1 file at a time.

I have come accross something else, that seems to be with Codeigniter but EllisLab don’t seem to think is an issue:

If you post more than one file, EE will upload each file, BUT:
EE renames the file to the same as the first file field, and adds the file extension on the end
eg, first file is billy.jpg, second file is sammy.png, EE will rename sammy.jpg to billy.jpg.png
I’m not not sure what to do as none of the hooks that I can see will allow me to do anything about this.

I could probably write some ghastly file rename script, and rename each file with [field_id]_[timestamp].ext
but that would be… ghastly :(

See:
http://codeigniter.com/bug_tracker/bug/10800/
http://codeigniter.com/bug_tracker/bug/9153/
http://codeigniter.com/bug_tracker/bug/6911/

A fix is available by hacking, comment out

$filename $this->file_name

from system/libraries/Upload.php (approx line 993)
see accepted answer here: http://stackoverflow.com/questions/1908247/codeigniter-multiple-file-upload

 Signature 

Weblog | @iain | Taxonomy for EE2

Profile
 
 
Posted: 10 July 2010 08:56 AM   [ Ignore ]   [ # 20 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  446
Joined  01-14-2006

Just following up Lee, did the new version work ok for you?

 Signature 

Weblog | @iain | Taxonomy for EE2

Profile
 
 
Posted: 10 July 2010 09:56 AM   [ Ignore ]   [ # 21 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  730
Joined  11-11-2006

Yes I did - -thank you very much. I should have got back to you but family stuff came up and I forgot. Tell you what would be the icing on the cake - a percentage upload complete indicator, or something along those lines. I’ve got a few euros spare if you’re interested in doing it.

Thanks again
Lee

Profile
 
 
Posted: 10 July 2010 10:02 AM   [ Ignore ]   [ # 22 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  446
Joined  01-14-2006

I’m working on a site that has multiple file uploads via saef right now,

If the project has time left over I’ll see what I can do,

Cheers.

 Signature 

Weblog | @iain | Taxonomy for EE2

Profile
 
 
   
2 of 2
2