473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Creating a pseudo filename for downloading? help!

Hi there all,

I have an interesting problem....

I work for a company that develops software for the building industry
and would like to distribute one of our software products via the
web.

here is the problem

The main file sits on my web server. We generate unique URLs for the
buyer to download the software. We also generate unique filenames and
store it in a database along with the unique URL This in essence is a
pseudo filename

When the user clicks on the URL that we send him I need the PHP
script to initiate the file transfer giving the user the pseudo
filename rather than the actual filename on the server

I have everything working except for the ability to send the user the
pseudo filename! at this moment in time we are sending them the same
filename as the file sitting on our server.

Is there anyway of doing this with PHP?

Any help would much be appreciated
Edit: In my code I have tried the following

header('Content-Description: File
Transfer');
header('Content-Type: application/force-download'); //
Tells the browser to expect a download
header("Content-Transfer-Encoding: Binary"); //
Tells the browser the format of the data
header('Content-Length: ' .
filesize($realfilename)); // Tells the browser the size
of the file
header('Content-Disposition: attachment; filename=' .
basename($uniquefilename)); // Tells the browser the
name of the file

readfile($realfilename);

As you can see I am reading the original filename's properties however
using the Content-Disposition header to tell the browser the filename
to download!

For some reason I.E always recieves a 0k file...???
http://eye.cc -php- web design
Aug 21 '05 #1
1 1717
On Sun, 21 Aug 2005 09:00:56 GMT, rudderstick wrote:
I have everything working except for the ability to send the user the
pseudo filename! at this moment in time we are sending them the same
filename as the file sitting on our server.


I haven't checked, but if there is no way around this using just header
commands, try copying the file to the required name, readfile()-ing that,
then delete the copy.

--
E. Dronkert
Aug 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
7
by: mike | last post by:
Hi, I am having difficulty in creating a thread using pthread_create. It seems that pthread_create does not execute 'program', and returns -1; I have checked the API but I am not sure why this...
2
by: rudderstick | last post by:
Hi there all, I have an interesting problem.... I work for a company that develops software for the building industry and would like to distribute one of our software products via the web. ...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: Adrian | last post by:
Using: Mysql 5.0.15 php 5.1.6 apache 2.2.3 I am trying to create a download link for various pdfs which I have stored in a mysql DB. I am having trouble with the header fields when clicking...
0
by: .nu | last post by:
#!/usr/bin/env python # -*- coding: utf-8 -*- # Name: Sleepy Hollow # Author: .nu import wx import os import sys
4
by: mtgrizzly52 | last post by:
Good evening all. I have a challenge that I have no clue on how to accomplish it. I am so close to completing a challenging database it's scary, but through beta testing we discovered a need for...
1
by: TechieGrl | last post by:
I want to save a zip file daily. The file is named the same thing each day so I would like to create a folder and name it with today's date and then save the zip file into that folder. I'm...
2
by: slizorn | last post by:
hi guys, i need to make a tree traversal algorithm that would help me search the tree.. creating a method to search a tree to find the position of node and to return its pointer value basically i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.