Note that there are some explanatory texts on larger screens.

plurals
  1. POFSO to copy save files. VBScript/ASP page using subroutine
    primarykey
    data
    text
    <p>I'm trying to use FSO = Server.CreateObject("Scripting.FileSystemObject") to copy/save files utilising a ASP utility called 'csImageFile'</p> <p>At present the FSO code I have is on a separate .asp page. This is called from a page when the user selects an option (using value="xxx.asp..." to call code page). This works fine.</p> <p>The problems is that the FSO code page response.redirects to the calling page and the refresh loses data.</p> <p>I'd like the 'onlclick' of the select/option to call the FSO code by placing the code in a subrouting on the original calling page (hence avoiding the refresh). I've tried this by various ways without success. I presently call a js function which itself then calls a VBscript subroutine. This is may not be correct but I've tried so many permutations I'm a bit lost now.</p> <p>on page</p> <pre><code>&lt;option onclick="calljsSub()"... </code></pre> <p>the scripts</p> <pre><code>&lt;script language="JavaScript"&gt; function calljsSub(){ //alert("js called"); VBFunc(); } &lt;/script&gt; &lt;script language="VBScript"&gt; Sub VBFunc() SET FSO = Server.CreateObject("Scripting.FileSystemObject") If FSO.FileExists ( "path to file") Then Set Image = Server.CreateObject("csImageFile.Manage") Image.ReadFile "path to file" Image.WriteFile Server.MapPath("path to new file") end if Set FSO = Nothing End Sub </code></pre> <p>The VBScript function appears to do nothing. Perhaps there is another way of runnning the code without refreshing?? Any advice is welcome.</p> <p>I'd be very grateful for any advice as I've been trying to solve this since before Christmas.</p> <p>Mark thanks Mark</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload