Uploading files via ejUploadbox without ashx-handlers
Hi Thong,
Thanks for using Syncfusion products.
Query: Is there a way to use the ejUploadbox if you cannot use the ashx web handlers on the server? Maybe using Javascript instead?
We would like to inform you that, it is not necessary to use web handler file (ashx) to save the files in server. Also it is not possible to save the files to server using client side script (JavaScript) alone. We need to use any server side code (like PHP, C# etc..) with ejUploadbox, to save the files in server. For your reference we have prepared a sample to showcase how to save the files in server using PHP. Please check with the sample in the following location.
Sample Location : EJUpload box Sample
The above sample can be run in any PHP compatible server (like XAMPP). The uploaded files will be saved into the directory ‘uploads’.
Please get back to us if you would require any further assistance.
Regards,
HariKrishnan
Hi Thong,
Thanks for your update.
Query: So when I understand correctly I need some server side code to handle my request. Can I use REST calls, too?
Yes, we need to use server side code to handle the file upload to server. We can also use REST web services for handling file upload process. We have prepared a simple sample to showcase this. Please check with the sample in the following location.
We have created a REST web service and a console application to host the service. Run the service first, you can see that the host is opened. Now run the EJ upload sample, in which we have used HTTPWebRequest and HTTPWebResponse to read and write the files to the server or specified location. When a file is uploaded you can see that the files are saved in the location ‘FileUpload’ in D: drive.
Note: You need to create a directory as ‘FileUpload’ in D: drive
Please let us know if you have further queries.
Regards,
HariKrishnan
- 3 Replies
- 2 Participants
-
TT Thong Ta
- Feb 25, 2015 09:25 AM UTC
- Feb 27, 2015 01:01 PM UTC