Hi,
I have a web user form which I'm using to create an object and upload a binary document (pdf). The objects are displayed using a listview and each item has a we:a link to edit or delete the object in the list. Currently the we:a delete link removes the object but not the associated binary file.
How do I remove both the object and the binary file at the same time?
Thanks,
Michael.
Delete object + binary file
Re: Delete object + binary file
maybe we can extend the delete option to delete all associtated files as well.
Currently, I think the only way is to call
deleteFile($id, $table, $path = "", $contentType = "")
which is defined in webEdition/we/include/we_delete_fn.inc.php
Currently, I think the only way is to call
deleteFile($id, $table, $path = "", $contentType = "")
which is defined in webEdition/we/include/we_delete_fn.inc.php
webEdition-Kern-Entwickler
-
- Senior Member
- Beiträge: 160
- Registriert: Mi 4. Feb 2004, 02:39
- Wohnort: London / UK
- Kontaktdaten:
Re: Delete object + binary file
Hi mokraemer,
Yes, I think it would be logical to have the option to delete associated files. The we:tag would need to specify the associated file field names and a override if the associated file is being used by another object.
Yes, I think it would be logical to have the option to delete associated files. The we:tag would need to specify the associated file field names and a override if the associated file is being used by another object.
Michael.mokraemer hat geschrieben:maybe we can extend the delete option to delete all associtated files as well.
Currently, I think the only way is to call
deleteFile($id, $table, $path = "", $contentType = "")
which is defined in webEdition/we/include/we_delete_fn.inc.php
Re: Delete object + binary file
would you mind to create a feature request in the bug base qa.webedition.org?
This helps us to keep track on features and bugs in WE.
This helps us to keep track on features and bugs in WE.
webEdition-Kern-Entwickler
-
- Senior Member
- Beiträge: 160
- Registriert: Mi 4. Feb 2004, 02:39
- Wohnort: London / UK
- Kontaktdaten:
Re: Delete object + binary file
Sure will do.
mokraemer hat geschrieben:would you mind to create a feature request in the bug base qa.webedition.org?
This helps us to keep track on features and bugs in WE.
-
- Senior Member
- Beiträge: 160
- Registriert: Mi 4. Feb 2004, 02:39
- Wohnort: London / UK
- Kontaktdaten:
Re: Delete object + binary file
Hi mokraemer,
This is the solution I'm testing, it appears to work ...
Class field name: DOC
UserInput field name: DOC
File name: My-Document.pdf
Uploaded file name: DOC_[WE_ID]_My-Document.pdf
/my_docs/listview.php
/my_docs/delete.php
As normal the listview's delete function view would be restricted by <we:ifRegisteredUser permission=" ... " and or userid=" ...">
Michael.
This is the solution I'm testing, it appears to work ...
Class field name: DOC
UserInput field name: DOC
File name: My-Document.pdf
Uploaded file name: DOC_[WE_ID]_My-Document.pdf
/my_docs/listview.php
Code: Alles auswählen
<we:listview type="object" name="DocListview" order="DocTitle" desc="false" classid="#" objectseourls="true" hidedirindex="false">
<we:repeat>
<we:comment>// ----- Get the associated binary document file name ----- //</we:comment>
<we:field type="binary" name="DOC" only="filename" to="global" nameto="FILE_ID_STR" />
<we:comment>// ----- Strip out the document id from the file name ----- //</we:comment>
<?php $FILE_ID = substr($FILE_ID_STR, 4, 3); ?>
<we:comment>// ----- Manually construct the delete link for both the Object and File (document) IDs ----- //</we:comment>
<a href="/my_docs/delete.php?we_delObject_ID=<we:field type="text" name="WE_ID" />&we_delDocument_ID=<?php echo $FILE_ID; ?>">Delete</a>
</we:repeat>
</we:listview>
Code: Alles auswählen
<we:delete type="object" classid="#" forceedit="true" />
<we:delete type="document" pid="###" forceedit="true" />
Michael.
Wer ist online?
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste