This discussion is archived
3 Replies Latest reply: Mar 25, 2013 12:12 PM by William Phelps RSS

Custom Check In page with CKEDITOR - How to upload file using javascript

996471 Newbie
Currently Being Moderated
We have a custom check in page (HCSF) with a ckeditor.

We want to give the users the ability to create content in ckeditor and then able to check it in.

Problem is :

<input type="file" name="primaryFile" maxlength=250> expects a manual click and then selecting

We are trying to some how evade that and whatever content is created using ckeditor we want it to be "considered" as the primaryFile.

We have a tmp folder where ckeditor writes that content. We want to plug it in as the primary file

Any idea how we can achieve this ?

Thanks,
Sunil
  • 1. Re: Custom Check In page with CKEDITOR - How to upload file using javascript
    William Phelps Expert
    Currently Being Moderated
    <input type="file" name="primaryFile" maxlength=250> expects a manual click and then selecting. We are trying to some how evade that and whatever content is created using ckeditor we want it to be "considered" as the primaryFile. We have a tmp folder where ckeditor writes that content. We want to plug it in as the primary file
    From javascript/html, there is no way to "evade" manually clicking and selecting a field of type "file". It would be considered a huge security hole if it could be "evaded". Instead of uploading your content file, it would just as easy to upload your Windows system registry, banking information, etc.

    You'd have to use signed applets of some type to emulate that type of behavior, and even that would have limitations as I recall.
  • 2. Re: Custom Check In page with CKEDITOR - How to upload file using javascript
    996471 Newbie
    Currently Being Moderated
    Thanks !

    So how do we use ckeditor as part of content creation

    A guys open New Checking Form -> Creates content using ckeditor -> checks in the content.

    Any idea how we can achieve this.. ?

    TThanks,
  • 3. Re: Custom Check In page with CKEDITOR - How to upload file using javascript
    William Phelps Expert
    Currently Being Moderated
    Probably your best bet would be to submit the data in a form POST, assemble the form fields to a file in a server-side routine, then check in the assembled file server-side. Probably that would be ok for text only stuff, but for images... don't have an idea if that would convert too well.

    There might be a few folks around on the list that have done something similar. Let them take a stab at this one.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points