Working with doksoft_uploader for asp.net Solved

User's avatar
Sara P.
14:33 Jan 15, 2015
I have been trying to get the doksoft uploader to work for my MVC project. The target framework is v4.0

I have been following the guide (http://doksoft.com/blog/asp-net-uploader-configuring.html) but am not having any luck.

My questions are:
1. Does the project have to be target framework 4.5? If so, do you have a v4.0 DLL we could use instead

2. I do not understand what the path should be for the handler. The example is "/doksoft_uploader/uploader" but the uploader is being bundled into the site as a reference. This part seems tailored for PHP, is it necessary and if so, is it the path to the DLL?

3. The directory for upload section states reference from the site root are available, however, are user uploaded content is in a folder outside of the wwwroot (c:\apps\site-name\userfiles). Is it possible to upload content here if i provide a virtual directory to the IIS entry?
User's avatar
Sara P.
14:50 Jan 15, 2015
4. I also notice plugin.js is minified. I am currently getting a "TypeError: window.doksoft_image_i18n is undefined" in firebug and it is impossible to debug.
Support team avatar
JS+
10:07 Jan 18, 2015
Hello,

1. Currently we have only one version on compiled DLL. You can just write the option to your IIS to use needed framework's version. Are there any problems with it?

2. The path to uploader is a URL mapped (routed) to your installed IIS application (DOKSoft Uploader). In fact you can change it anyway you want, but please change a URL mapping too.

3. I am not very similar with IIS but I think if you have this directory outside of website's root you can do a link to it and configure baseDir parameter to it. Anyway you will be need to do something about it because you will need not only upload images but and to show (download) them. So the directory must be somehow mapped in your IIS too.

4. What the plugin tells you this mistake? Does it affect any plugin fail? I will check and fix it.
User's avatar
Sara P.
13:23 Jan 21, 2015
Hi

Thank you for coming back to me. I have made the following setting/config changes but the plugin is still not working.

1. I have updated the target framework of our application to .net 4.5

2. I have created a virtual directory "estore_content" in IIS against the website that points to the C:\Apps\website\estore

Within this folder I have added
> "doksoft_uploader/uploader/DoksoftUploaderLibrary.dll"
> "doksoft_uploader/userfiles"

3. My web.config file has the following entries

<appSettings>
<add key="doksoft_uploader_base_dir" value="/estore_content/doksoft_uploader/userfiles" />
<add key="doksoft_uploader_file_max_size" value="0" />
<add key="doksoft_uploader_image_max_size" value="0" />
<add key="doksoft_uploader_file_allowed_extensions" value="*" />
<add key="doksoft_uploader_image_allowed_extensions" value="*" />
<add key="doksoft_uploader_jpeg_quality" value="95" />
<add key="doksoft_uploader_max_img_resize_width" value="2000" />
<add key="doksoft_uploader_max_img_resize_height" value="2000" />
<add key="doksoft_uploader_max_thumb_resize_width" value="500" />
<add key="doksoft_uploader_max_thumb_resize_height" value="500" />
</appSettings>

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<add name="UploaderHandler" verb="*" path="/estore_content/doksoft_uploader/uploader" type="DoksoftUploaderLibrary.UploaderHandler, DoksoftUploaderLibrary"/>
</handlers>
</system.webServer>

4. I have added the "doksoft_image" folder from the bundle to "/path/to/tinymce/plugins"

5. My TinyMCE initialisation:

tinymce.init({
doksoft_uploader_url: "/estore_content/doksoft_uploader/uploader",
menubar: false,
mode: 'textareas',
plugins: ["link, image, textcolor, autoresize, table, doksoft_image"],
relative_urls: false,
selector: ".js-tinyify",
statusbar: false,
style_formats: [
{ title: 'Header', inline: 'span', classes: 'cute-h1' },
{ title: 'Subheader', inline: 'span', classes: 'cute-h2' },
],
tabfocus_elements: ":prev,:next",
toolbar: 'undo redo | styleselect removeformat | fontsizeselect | bold italic underline | alignleft aligncenter alignright justify | bullist numlist | forecolor backcolor | link unlink | doksoft_image'
});

Given all of this, the TinyMCE dialog does not load and I get the following JS error in Firebug:

TypeError: window.doksoft_image_i18n is undefined

Whilst minified so I cannot debug the error appears to occur on "return window["doksoft_image_i18n"][j]......"

I cannot see what is missing. However, I am sure the DLL does not need to be referenced as these are precompiled. Can you please advise.
Support team avatar
JS+
07:25 Jan 25, 2015
Hello,
Could you tell me an URL where I can test your installation?
DLL or other server side parts can not affect to loading of the plugins, I think there is some problem with retrieving language files by browser or some other problems on client side.
User's avatar
Sara P.
15:19 Jan 26, 2015
http://cpd4beta-demo.webbased.co.uk/estore/Home/Test
Support team avatar
JS+
06:01 Jan 28, 2015
Unfortunately I have the 404-th error using this link.
User's avatar
Sara P.
09:59 Jan 29, 2015
please load this page first:

http://cpd4beta-demo.webbased.co.uk/estore

then:

http://cpd4beta-demo.webbased.co.uk/estore/Home/Test
Support team avatar
JS+
08:21 Jan 30, 2015
I see the reason of the problem. You need to include this script hosted on your server into your page:
/estore/Static/tinymce/plugins/doksoft_image/langs/en.js
I do not fully understand why it was happen that it was not included automatically. Does your TinyMCE wrap module uses custom mechanism of loading TinyMCE's plugins?
Maybe manual including it to your page can fix the problem? In that case it will be fully equivalent to default TinyMCE behavior.
User's avatar
Sara P.
09:35 Jan 30, 2015
I have added the script which now loads the modal window. However I am getting a "HTTP Error" when clicking the OK button after selecting an image.
Support team avatar
JS+
06:15 Feb 05, 2015
As I can see in browser's debugger you are getting a error #404. That means that you need to check URL of uploader on client side and URL mappings on the server side.

See attached screenshot.
 aspnetdebug.png   98.4 KB
User's avatar
Sara P.
09:28 Feb 06, 2015
Ok, i will take a look. Can you confirm what file is expecting to be at the location?
User's avatar
Sara P.
16:15 Feb 06, 2015
I think I must be missing something,. I am reviewing your installation guide and this section is confuising me:

<pre>
At the bottom of the file you can see the string:

<add name="UploaderHandler" verb="*" path="/doksoft_uploader/uploader" type="DoksoftUploaderLibrary.UploaderHandler, DoksoftUploaderLibrary"/>

Change "path" parameter as you want to tell the IIS server what the URL to map to uploader library handler.
</pre>

What file should be at this location for the .net version of your plugin? Is it the dll? Surely the dll is compiled at build time?

Thank you for your help.
User's avatar
Sara P.
16:19 Feb 06, 2015
I think it would really help if you could provide a sample .net project running this plugin.
User's avatar
Sara P.
10:51 Feb 10, 2015
I have managed to get the plugin working. I think your instructions need to be more clear that it is our responsibility to write the handler.

In the end I just added this as a method to our document controller.

public void DoksoftUploader()
{
UploaderHandler uploadHandler = new UploaderHandler();
uploadHandler.ProcessRequest(System.Web.HttpContext.Current);
}

And updated web config as:
<add name="UploaderHandler" verb="*" path="/Document/DoksoftUploader" type="DoksoftUploaderLibrary.UploaderHandler, DoksoftUploaderLibrary"/>


Thanks for all your assistance. I would still suggest creating a sample .net project to include in your download pack for others using the plugin.
Support team avatar
JS+
07:52 Feb 14, 2015
Thank you for remark. I will show it to our ASP.NET developer him to take a look and fix instructions.