# Open/Save file from web client

**URL:** <https://forum.servoy.com/t/open-save-file-from-web-client/6862>\
**Category:** Classic Servoy\
**Created:** [December 14, 2006, 4:43pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862 "2006-12-14T16:43:25Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![nric](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nric](https://forum.servoy.com/u/nric)\
**Post date:** [April 21, 2009, 8:29am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/41 "2009-04-21T08:29:17Z")

</div>

What I still don’t get is how to save files to a local drive.  
By pressing the SAVE button [attachment=0]SaveOpenDel.JPG[/attachment]  
my browser opens a PREVIEW window and not a SAVE DIALOG window.

Is there a way to change this behavior ? It depends on browser’s settings ?

![SaveOpenDel.JPG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/a/a33021ee011a7d04643cc91e558f8eb92ad805df.jpeg)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [April 21, 2009, 10:26am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/42 "2009-04-21T10:26:12Z")

</div>

what are you trying to save?

---

<div class="post-metadata">

**Author:** ![nric](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@nric](https://forum.servoy.com/u/nric)\
**Post date:** [April 21, 2009, 10:43am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/43 "2009-04-21T10:43:54Z")

</div>

I save xls, doc, image files, pdf, msg (emails) … various file types that are inherent with the management of quality complains.  
Up to now my application accepts any file.

Note:  
when testing all that staff with the developer / web client, everything works as the smart client.

---

<div class="post-metadata">

**Author:** ![Marco\_R](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marco\_R](https://forum.servoy.com/u/Marco_R)\
**Post date:** [April 21, 2009, 12:59pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/44 "2009-04-21T12:59:05Z")

</div>

hi,

i’ve the same problem.  
i work with sevoy 4.1.2 and need to save an attach from the db by the webclient.  
the step that i follow are:

1- i have an mp3 into my db (with other file that doesn’t allow a preaview work in the same mode)  
[attachment=2]mp3 prima.JPG[/attachment]

2 - then i click on floppy image and appear the save-browser-dialog(mozilla,ie7 work like this)  
[attachment=1]mp3 seconda dialog salvataggio.JPG[/attachment]

3 - at last i choose to save my file by click on “save” button but the result is a file with bad filename and bad extension  
[attachment=0]mp3 terza nome.JPG[/attachment]

if i rename the file it work properly then it isn’t corrupted.

into my db there are the field in wich are stored filename and filetype,i’ve done this following Johan’s instructions too.

p.s. exist into servoy 4.1.2 a way to retrive DESKTOP path.

thanks for your attention

Marco

 ![mp3 terza nome.JPG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/7/7158a3c0ec85941fbbbc88e13cd1642ec1fdd9e7.jpeg)

 ![mp3 seconda dialog salvataggio.JPG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/d/dc883e59dde622cdda7b31f05bd41f25d68b60ee.jpeg)

 ![mp3 prima.JPG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/4/433b65af7aac9313a13651ca6170ae9dfe1807f8.jpeg)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [April 23, 2009, 9:01am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/45 "2009-04-23T09:01:42Z")

</div>

I think the download stuff of the Media field doesnt use the 2 new fields yet.

Please make a case for this so that we will address this.

---

<div class="post-metadata">

**Author:** ![Marco\_R](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marco\_R](https://forum.servoy.com/u/Marco_R)\
**Post date:** [April 23, 2009, 12:06pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/46 "2009-04-23T12:06:33Z")

</div>

i’ve just done it johan,thanks for your help

Marco

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [May 7, 2009, 8:28am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/47 "2009-05-07T08:28:44Z")

</div>

The remaining use cases related to name&type fields are implemented.  
Starting with Servoy 4.1.3 image/media fields in both smart and web client will populate “x\_filename” and “x\_mimetype” in case of upload(load) and use them in case of download(save) - where “x” is a media dataprovider.

---

<div class="post-metadata">

**Author:** ![gregborn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gregborn](https://forum.servoy.com/u/gregborn)\
**Post date:** [September 22, 2009, 5:47pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/48 "2009-09-22T17:47:39Z")

</div>

Is there a way to “Load” a media file without having the user click the little icon in a media field?

In Servoy 4.1.x web-client only I’d like to be able to have a button other than one that sits between two other small icons in a media field. The UI for how this looks when deployed is the primary issue. The acts of saving and/or removing an image aren’t needed… I just want to trigger the opening of the client’s file picker dialog box and let them choose what to upload.

Greg

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [September 23, 2009, 8:55am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/49 "2009-09-23T08:55:37Z")

</div>

there is currently no other way for a user to upload files.  
Make a feature request if you want more options.

---

<div class="post-metadata">

**Author:** ![gregborn](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gregborn](https://forum.servoy.com/u/gregborn)\
**Post date:** [September 23, 2009, 1:34pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/50 "2009-09-23T13:34:31Z")

</div>

Feature request 244315 added this morning.

---

<div class="post-metadata">

**Author:** ![Marco\_R](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marco\_R](https://forum.servoy.com/u/Marco_R)\
**Post date:** [September 24, 2009, 9:14am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/51 "2009-09-24T09:14:59Z")

</div>

Hi,

Greg have you asked only for upload button or else for the other?  
And one more for Johan: When you will solve the issue:Will you put some events like: onUpload or similar?

Marco

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [September 24, 2009, 9:58am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/52 "2009-09-24T09:58:46Z")

</div>

I think the bottomline is here, that we would like to have some more control, about webupload & download.

I know, we can already, catch the filename & mimetype.  
but we can’t create or own buttons/design, for this and can’t create methods, so we can script up & downloads by web, right?

This would have my vote! ![;-)]( "Wink")

---

<div class="post-metadata">

**Author:** ![Westy](https://avatars.discourse-cdn.com/v4/letter/w/9de053/32.png) [@Westy](https://forum.servoy.com/u/Westy)\
**Post date:** [September 24, 2009, 6:15pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/53 "2009-09-24T18:15:55Z")

</div>

> Harjo:  
> I think the bottomline is here, that we would like to have some more control, about webupload & download.
> 
> I know, we can already, catch the filename & mimetype.  
> but we can’t create or own buttons/design, for this and can’t create methods, so we can script up & downloads by web, right?
> 
> This would have my vote! ![;-)]( "Wink")

I second that motion!

Dean Westover

---

<div class="post-metadata">

**Author:** ![bobcusick](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@bobcusick](https://forum.servoy.com/u/bobcusick)\
**Post date:** [September 28, 2009, 4:16am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/54 "2009-09-28T04:16:01Z")

</div>

> Harjo:  
> I think the bottomline is here, that we would like to have some more control, about webupload & download.
> 
> I know, we can already, catch the filename & mimetype.  
> but we can’t create or own buttons/design, for this and can’t create methods, so we can script up & downloads by web, right?
> 
> This would have my vote! ![;-)]( "Wink")

+1 on this!

---

<div class="post-metadata">

**Author:** ![erdione](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@erdione](https://forum.servoy.com/u/erdione)\
**Post date:** [September 28, 2009, 6:04am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/55 "2009-09-28T06:04:10Z")

</div>

> Harjo:  
> I think the bottomline is here, that we would like to have some more control, about webupload & download.
> 
> I know, we can already, catch the filename & mimetype.  
> but we can’t create or own buttons/design, for this and can’t create methods, so we can script up & downloads by web, right?
> 
> This would have my vote! ![;-)]( "Wink")

+1

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [September 28, 2009, 6:22am UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/56 "2009-09-28T06:22:35Z")

</div>

oke, thanks for the vote, but did any of us, filed a request? ![;-)]( "Wink")  
I’m not sure, so I did, with a pointer to this topic: feature request: 245204

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 22, 2009, 4:39pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/57 "2009-12-22T16:39:57Z")

</div>

i looked into this a bit more  
and it is just not really doable in the webclient because of security constraints  
for example it is not possible that you place a button on a form where you then say “showFileInputdialog” on  
thats impossible to do in a webclient because of security constraints

The user must click on something them self and that something must then open it right away in the browser and that is doable with a upload field  
or with a flash thing like google uses for its upload.  
But a user client action is always needed.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [December 22, 2009, 7:07pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/58 "2009-12-22T19:07:24Z")

</div>

Johan, is it possible to only make or own method, that opens the upload window, that Servoy now is already using? and THAN users push that button, to browse a file?

so we dont have to use, the media-field, with there (IMHO ugly ![;-)]( "Wink") ) buttons?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 22, 2009, 9:17pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/59 "2009-12-22T21:17:01Z")

</div>

I think we could map the openfiledialog in the file plugin to open up that upload window.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 29, 2009, 4:42pm UTC](https://forum.servoy.com/t/open-save-file-from-web-client/6862/60 "2009-12-29T16:42:26Z")

</div>

ok for 5.1 i improved the file plugin for the web.

showFileDialog() can now have a callback function as (extra) parameter  
when you give that in the web it will open up a Dialog where a user can select a file  
then the call back method will get that file back.

also readTXTFile() or readFile() are supported in the web if you give a JSFile (that you get from the showFileDialog callback method)

Also writeFile, writeTXTFile and writeXMLFile methods are now supported in the web

as an example:

```auto
function openFileDialog(event)
{
	plugins.file.showFileOpenDialog(0,"",false,null,uploaded);
}
function uploaded(files)
{
	media = files[0].getBytes();
}

```

also the fileupload dialog is now a modal ajax dialog so it is much nicer to work with.

[Previous page](https://forum.servoy.com/t/open-save-file-from-web-client/6862.md?page=2)

[Next page](https://forum.servoy.com/t/open-save-file-from-web-client/6862.md?page=4)
