# Params\[:file\] attributes lost within Scheduler::Defer

**URL:** <https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107>\
**Category:** Product Support\
**Created:** [12.Май.2016 08:51:43 UTC](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107 "2016-05-12T08:51:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![williamherry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/williamherry/32/104524_2.png) [@williamherry](https://meta.discourse.org/u/williamherry)\
**Post date:** [12.Май.2016 08:51:43 UTC](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107/1 "2016-05-12T08:51:43Z")

</div>

I deployed a instance manually on a centos host, image upload does not work, after several hours of debug, I find file in Scheduler::Defer block lost some attribites, see debug code below

```
def create
    type = params.require(:type)
    file = params[:file] || params[:files].try(:first)
    url = params[:url]
    client_id = params[:client_id]
    synchronous = is_api? && params[:synchronous]

    if type == "avatar"
      if SiteSetting.sso_overrides_avatar || !SiteSetting.allow_uploaded_avatars
        return render json: failed_json, status: 422
      end
    end

    Rails.logger.error(file.tempfile.path) # =>url

    if true #synchronous
      data = create_upload(type, file, url)
      render json: data.as_json
    else
      Scheduler::Defer.later("Create Upload") do
        Rails.logger.error(file.tempfile.path) # => nil
        data = create_upload(type, file, url)
        MessageBus.publish("/uploads/#{type}", data.as_json, client_ids: [client_id])
      end
      render json: success_json
    end
  end

```

any one know what’s going on here?

---

_[View the full topic](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107)._
