I have a Safecracker form that contains a Matrix field, that contains an Assets field.

Is there anyway to handcraft the matrix field as per this article:

Whilst using an Asset field?

I've found this SE question that relates to using a simple HTML file field in for Assets:

However I cannot get this to work when it sit's inside a Matrix field. I'm using the code below; assets_file is the name of the Matrix field, and the 2nd Matrix Column is a textfield which saves to the database on submission OK.

{exp:safecracker channel="asset" return="/assets/upload/success"}

  {!-- Row Order Value --}
  <input type="hidden" name="asset_files[row_order][]" value="row_new_0">

  {!-- 1st Column Asset Field --}
  <input type="file" name="asset_files[row_new_0][col_id_1]" value="">
  <input type="hidden" name="asset_files[row_new_0][col_id_1]_filedir" value="2">

  {!-- 2nd Column Text Field --}
  <input type="text" name="asset_files[row_new_0][col_id_2]" value="">

  {!-- Title & URL Title fields removed for simplicity --}

  <input type="submit" name="submit" value="Submit">


I've tried using the name of asset_files_filedir for the hidden field of the 1st Column Asset Field, but it doesn't make a difference.

To clarify the form submits successfully - creates the entry and even adds the 2nd Column Text Field to the matrix field. It is only the file that doesn't get uploaded.

I suppose I asking if this is possible, and if so does anyone know how would I do this?

  • EE: 2.5.5
  • Safecracker: 2.1
  • Matrix: 2.5.5
  • Assets: 2.1.4


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.