5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 206 Views |
-
Upload Field issue

21 November 2012 at 9:51pm Last edited: 22 November 2012 2:20am
I am using SilverStripe 3.0
I am using UploadField to enable file upload from Silverstripe admin
I have written the following code in my custom Page Type:
//has_one array
static $has_one = array(
"MyIcon1" => "File"
);//in getCMSFields
$fields->addFieldToTab("Root.Images", new UploadField('MyIcon1'));My problem is that on a direct first page load, the upload does not work i.e. if you refresh the page or if you go to this page by typing its url, the file browser window is shown and after you select the file it only closes the file browser does not upload anything.....This happens in mozilla firefox only..
if u go to some other page and come back that is after ajax page loads it starts working....
Any help will be appreciated...Thanks in advance...
-
Re: Upload Field issue

23 November 2012 at 11:44pm
I was trying to follow the flow of UploadField.js and by adding alert is making the upload work properly on the first load also:
line no 59 approx. in framework/javascript/UploadField.js
$.entwine('ss', function($) {
$('div.ss-upload').entwine({
Config: null,
onmatch: function() {
alert('match');Can someone please explain the reason..is there any particular event which is fired when i am alerting something....is there something that i can do on similar lines to make the upload work without alerting???
| 206 Views | ||
|
Page:
1
|
Go to Top |

