Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

PDF Stamper, fseek() Error

by

Tips and Tricks HQ Support Portal › Forums › WP PDF Stamper › PDF Stamper, fseek() Error

  • This topic has 7 replies, 2 voices, and was last updated 14 years, 8 months ago by amin007.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • September 11, 2010 at 11:41 am #1821
    wzp
    Moderator

    Hi Amin, per Ivy’s stated preference, I moved my query to the forums.

    Any idea on what is causing, or status report, on my fseek() “May not be used on file pointers returned by fopen() if they use the http:// or ftp:// formats” error?

    September 12, 2010 at 12:14 am #24180
    wzp
    Moderator

    Just “for the fun of it,” I replaced the URL of the source file I was trying to manually stamp, with the absolute path and got yet another error:

    Warning: fopen(url-of-output-file-goes-here) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/content/45/4753628054/html/wp-content/plugins/wp-pdf-stamper/lib/fpdf/fpdf.php on line 0

    I then changed the “Destination Directory of Stamped Files” to the absolute path of the output directory. Note, the default was a URL path.

    Now, manual stamping works!!!!!!!!!!!!!!

    Okay, so now I’m going to see if I can make this work with eStore. I don’t mind if I have to use the absolute path of the “stamped file directory,” but I’d sure hate having to change the eStore file URLs into absolute paths.

    Perhaps, since we now know how to workaround the issue, you could maybe code some kind of function that would convert URL to & from absolute paths?

    September 12, 2010 at 12:42 am #24181
    wzp
    Moderator

    Now this is getting weird…

    After I got it to work, using absolute paths for everything; manual stamping is suddenly working with URLs.

    Perhaps there is some kind of uninitialized database or variable situation going on here? Wil do some more testing and will report back…

    September 12, 2010 at 1:11 am #24182
    wzp
    Moderator

    Sigh, you’re still going to have to code an abolute path to/from URL conversion function…

    When trying to delete files under “Manage Stamped Files,” I get:

    Warning: unlink() [function.unlink]: http does not allow unlinking in /home/content/44/477758054/html/wp-content/plugins/wp-pdf-stamper/manage_stamped_files_page.php on line 0

    I figure it’s because it’s trying to unlink files based on their URL.

    Well, now that I know to to tippy-toe around these issues, I can at least move forward; and you get a wee-bit more space in order to properly fix PDF Stamper, LOL.

    As for the original problem with the fssek() I kind of suspect that it can only be recreated on a clean installation, that has never had PDF Stamper installed.

    September 12, 2010 at 1:22 am #24183
    wzp
    Moderator

    P.S. before deleting the entries from the “Managed Stamped Files” database, I think you should test to ensure the unlink() was successful. Otherwise, in case of failed unlink() like in this situation, the database and the directory will be out of sync.

    September 12, 2010 at 2:00 am #24184
    amin007
    Participant

    Both Relative or Full URL will work with the stamping. You just need to make sure that you are entering the relative path correctly as it needs to be relative to the PDF stamper’s “api” directory otherwise when it tries to open the file it won’t find the path.

    This is why using a full URL in this case is easier as you don’t have to calculate what the relative URL should be for each of your files as you just copy the URL of the file and paste it in the field.

    “I think you should test to ensure the unlink() was successful” – that’s what you will ideally do but an unlink can go wrong for a lot of reasons and I didn’t want the users to be stuck with the entry in the database as the unlink is failing (sometimes you just won’t be able to get it to work). It’s really easy to delete the files from your server just by browsing to the “stamped-files” directory and deleting the files manually if an unlink goes bad. This way you know that the database record was successfully cleaned and you just need to manually delete the file from the “stamped-files” directory (all the files are time stamped so you can delete them in bulk every month or so)

    I do have plans to add a feature so the admin can schedule an auto deletion of stamped files after so many hours.

    September 12, 2010 at 2:04 am #24185
    wzp
    Moderator

    The “API directory” is the plugin directory?

    September 12, 2010 at 2:19 am #24186
    amin007
    Participant

    Inside the PDF stamper directory there is a folder called “api”

    So for example if you had a file uploaded in the following URL:

    http://www.example.com/wp-content/uploads/testfile.pdf

    The relative URL for the above (relative to the “api” directory) would be the following:

    ../../../uploads/testfile.pdf

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ