Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

430
Views
I can't seen to access the added object property in app script, this property is visible in js though. e.fn is undefined in code.gs

I can't seen to access the added object property in app script, this property is visible in js though. e.fn is undefined in code.gs

HTML

<input type="button" value="Upload" onclick="jsupload(this.parentNode)"/>

JS

function jsupload(ee) {
 if (confirm("Upload picture of " + '[' + fullinfo[1] + '] ' + fullinfo[2] + '?!?') == true) {
   // ee['fn'] = "hey"
   Object.defineProperty(ee, 'fn', {
     value: 'hey'
   })
   google.script.run.withSuccessHandler(showResult).upload(ee)
 }
}

code.gs

function upload(e) {
  var destination_id = 'XXXXXXXXXXXXXXXX'
  var img = e.imageFile
  var contentType = 'image/png'
  var destination = DriveApp.getFolderById(destination_id)
  var img = img.getAs(contentType)

  var newFile = destination.createFile(img).setName(e.fn) // e.fn undefine

  var newFileLink = "http://drive.google.com/uc?export=view&id=" + newFile.getId()

  return newFileLink
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!