473,385 Members | 1,958 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,385 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 1724
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.