Use FileGenie Delete Link with Dynamic Folders Support
Question:
How can I have the FileGenie Delete Link keep my URL parameter when using Dynamic Folders?
Answer:
When using FileGenie's Delete Link and also using Dynamic Folders, the use of the Delete Link would result in a redirect to the page the link was on, but without the URL parameter! To have the Delete Link retain the URL parameter, two changes in the incFSClass.asp are necessary.
Browse to the ScriptLibrary and open the file incFSClass.asp. Find the code for the Function getDeleteLink() and edit it so that it looks like this:
Public Function getDeleteLink()
Dim currentPage
currentPage = Request.ServerVariables("SCRIPT_NAME")
getDeleteLink = currentPage & "?yoururlparameter=" & Request.QueryString("yoururlparameter") & "&Action=delete&file=" & Server.Urlencode(Files("Path"))
End Function
It is also necessary to edit the Response.Redirect in the fm_DeleteListedFile (4th line from below!) in the way described below.
Sub fm_DeleteListedFile(FM_suffix)
Dim fileToDelete,currentPage, cur_fso
Set cur_fso = CreateObject("Scripting.FileSystemObject")
if LCase(Request.QueryString("Action")) = "delete" then
if Request.QueryString("file") <> "" then
currentPage = Request.ServerVariables("SCRIPT_NAME")
fileToDelete = Server.MapPath(Request.QueryString("file"))
if cur_fso.FileExists(fileToDelete) then
cur_fso.DeleteFile fileToDelete,true
if cur_fso.FileExists(fm_getThumbnailName(FM_suffix,fileToDelete)) then
cur_fso.DeleteFile fm_getThumbnailName(FM_suffix,fileToDelete),true
end if
elseif cur_fso.FolderExists(fileToDelete) then
cur_fso.DeleteFolder fileToDelete,true
end if
Response.Redirect currentPage & "?yoururlparameter=" & Request.QueryString("yoururlparameter")
end if
end if
End Sub
Save the file and close it. Upload it to your website.
Note: Be carefull when using multiple pages with a FileGenie Delete Link. All of these page use the same file incFSClass.asp!
That's basically it. Preview the result on a live page and see what happens!
I'd really appreciate your feedback on your results! If you have any more questions just let me know!
Comments
Be the first to write a comment
You must me logged in to write a comment.